CN113342389B - Service updating method and device and computer readable storage medium - Google Patents

Service updating method and device and computer readable storage medium Download PDF

Info

Publication number
CN113342389B
CN113342389B CN202110604530.7A CN202110604530A CN113342389B CN 113342389 B CN113342389 B CN 113342389B CN 202110604530 A CN202110604530 A CN 202110604530A CN 113342389 B CN113342389 B CN 113342389B
Authority
CN
China
Prior art keywords
function
fault
address
logic
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
CN202110604530.7A
Other languages
Chinese (zh)
Other versions
CN113342389A (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.)
Shenzhen Tencent Network Information Technology Co Ltd
Original Assignee
Shenzhen Tencent Network Information 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 Shenzhen Tencent Network Information Technology Co Ltd filed Critical Shenzhen Tencent Network Information Technology Co Ltd
Priority to CN202110604530.7A priority Critical patent/CN113342389B/en
Publication of CN113342389A publication Critical patent/CN113342389A/en
Application granted granted Critical
Publication of CN113342389B publication Critical patent/CN113342389B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/658Incremental updates; Differential updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0793Remedial or corrective actions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Abstract

The application provides a service updating method, a service updating device and a computer readable storage medium; the method comprises the following steps: when a service process fails, acquiring a patch file corresponding to the failure and an initial address of a failure function; analyzing the address of a logic repair function in the patch file in a mode of loading the patch file by a service process, wherein the logic repair function is a correct version of a fault function; writing an operation instruction from the initial address of the fault function, wherein the operation instruction is used for writing the address of the logic repair function into a register and enabling a service process to jump to the address of the logic repair function when the fault function is executed so as to execute the logic repair function; and repairing the data fault generated by the fault function by executing the data repair function in the patch file. By the aid of the method and the device, the fault of the service process can be efficiently repaired without restarting the service process, and the capacity of solving the fault on the emergency line is effectively improved.

Description

Service updating method and device and computer readable storage medium
Technical Field
The present application relates to the field of internet technologies, and in particular, to a service updating method and apparatus, and a computer-readable storage medium.
Background
With the continuous development of network technology, the intelligent client becomes the main way for users to play games and communicate. However, errors occur occasionally in the service process for providing services for the intelligent terminal, so that the service process cannot provide services for the intelligent client normally. If the error occurred in the service process is not immediately repaired, huge loss is brought to the user and the operator of the intelligent client.
At present, for repairing a service process error in the related art, the service process needs to be shut down to repair the error, so that the service process cannot provide service for the intelligent client in a repair time period, and user experience is still affected. There is no effective solution for the error-related technique of repairing a service process without affecting the user experience.
Disclosure of Invention
The embodiment of the application provides a service updating method and device and a computer readable storage medium, which can repair errors of a service process in the running process of the service process so as to ensure the continuity of the service.
The technical scheme of the embodiment of the application is realized as follows:
an embodiment of the present application provides a service update method, including:
when a service process fails, acquiring a patch file corresponding to the failure and an initial address of a failure function;
analyzing the address of a logic repair function in the patch file in a mode of enabling the service process to load the patch file, wherein the logic repair function is a correct version of the fault function;
writing an operation instruction from a starting address of the fault function, wherein the operation instruction is used for writing an address of the logic repair function into a register and making the service process jump to the address of the logic repair function when the fault function is executed so as to execute the logic repair function;
and repairing the data fault generated by the fault function in a mode of executing the data repair function in the patch file.
An embodiment of the present application provides an update apparatus for a service, including:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a patch file corresponding to a fault and an initial address of a fault function when the service process fails;
the analysis module is used for analyzing the address of a logic repair function in the patch file in a mode of loading the patch file by the service process, wherein the logic repair function is a correct version of the fault function;
a first repair module, configured to write an operation instruction from a start address of the fault function, where the operation instruction is configured to write an address of the logical repair function into a register and cause the service process to jump to the address of the logical repair function when the fault function is executed, so as to execute the logical repair function;
and the second repairing module is used for repairing the data fault generated by the fault function in a mode of executing the data repairing function in the patch file.
In the above scheme, the first repair module is further configured to write the data transfer instruction from a start address of the fault function, where the data transfer instruction is used to write an address of the logical repair function into a register; continuing to write the jump instruction after writing the data transmission instruction, wherein the jump instruction is used for causing the service process to jump to the address of the logic repair function when executing the fault function so as to execute the logic repair function.
In the above scheme, the first repair module is further configured to write, starting from the start address of the fault function, a data transfer instruction including an address of the logical repair function, where the data transfer instruction is used to write the address of the logical repair function into a register.
In the above scheme, the first repair module is further configured to write, starting from the start address of the fault function, a data transfer instruction including a specific address and an address of the logical repair function, where the specific address is an address having an offset from the start address of the fault function.
In the foregoing solution, the apparatus for updating a service further includes: the generating module is used for generating a repair file for repairing the fault according to the fault function; and the compiling module is used for compiling the repair file to obtain a patch file corresponding to the fault.
In the foregoing solution, the generating module is further configured to generate the logic repair function for repairing the logic fault according to the logic fault; and generating the data repair function for repairing the data failure according to the data failure.
In the foregoing solution, the service updating apparatus further includes: and the first permission module is used for endowing writable permission to the storage space with the specific length from the starting address of the fault function by calling a system interface function.
In the foregoing solution, the service updating apparatus further includes: and the second permission module is used for canceling the writable permission from the storage space with the specific length starting from the starting address of the fault function by calling the system interface function.
In the above solution, the first permission module is further configured to assign a writable permission to a storage space with a specific length starting from a start address of the fault function by calling a first parameter included in a system interface function; wherein the first parameter is used to make the content in the storage space of the specific length writable.
In the above scheme, the second permission module is further configured to cancel the writable permission for the storage space with the specific length starting from the start address of the fault function by calling a second parameter included in the system interface function; wherein the second parameter is used to make the content in the storage space of the specific length unwritable.
An embodiment of the present application provides an electronic device, including:
a memory for storing executable instructions;
and the processor is used for realizing the service updating method provided by the embodiment of the application when the executable instructions stored in the memory are executed.
The embodiment of the present application provides a computer-readable storage medium, which stores executable instructions and is used for implementing the method for updating the service provided by the embodiment of the present application when being executed by a processor.
The embodiment of the application has the following beneficial effects:
the service process loads a patch file comprising a data repair function and a logic repair function, and an operation instruction is written in the initial address of the fault function, so that the service process jumps to execute the logic repair function when executing the fault function, and the service process is ensured to provide a correct logic function for a user through the logic repair function; meanwhile, the data fault generated by the fault function is repaired in a mode of executing the data repair function in the patch file; therefore, the logic errors and the data errors of the service process can be repaired under the condition of not influencing the operation of the service process.
Drawings
FIG. 1 is a schematic structural diagram of an update system architecture of a service provided by an embodiment of the present application;
fig. 2 is a schematic structural diagram of a terminal of a method for updating a service of a device provided in an embodiment of the present application;
FIG. 3 is a flowchart illustrating a method for updating services provided by an embodiment of the present application;
FIG. 4 is a flowchart illustrating a method for updating a service provided by an embodiment of the present application;
FIG. 5 is a flowchart illustrating a method for updating a service provided by an embodiment of the present application;
FIG. 6 is a flowchart illustrating a method for providing an update to a service according to an embodiment of the present application;
FIG. 7 is a flowchart illustrating a method for providing an update to a service according to an embodiment of the present application;
fig. 8 is a flowchart illustrating a method for providing an update of a service according to an embodiment of the present application.
Detailed Description
In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be described in further detail with reference to the attached drawings, the described embodiments should not be considered as limiting the present application, and all other embodiments obtained by a person of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
In the following description, reference is made to "some embodiments" which describe a subset of all possible embodiments, but it is understood that "some embodiments" may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict.
In the following description, references to the terms "first \ second \ third" are only to distinguish similar objects and do not denote a particular order, but rather the terms "first \ second \ third" are used to interchange specific orders or sequences, where appropriate, so as to enable the embodiments of the application described herein to be practiced in other than the order shown or described herein.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of the present application only and is not intended to be limiting of the application.
Before further detailed description of the embodiments of the present application, terms and expressions referred to in the embodiments of the present application will be described, and the terms and expressions referred to in the embodiments of the present application will be used for the following explanation.
1) Cloud storage (cloud storage) is a new concept extended and developed on the cloud computing concept, and a distributed cloud storage system (hereinafter referred to as a storage system) refers to a storage system which integrates a large number of storage devices (storage devices are also referred to as storage nodes) of various types in a network through application software or application interfaces to cooperatively work through functions of cluster application, a grid technology, a distributed storage file system and the like, and provides a data storage function and a service access function to the outside. At present, a storage method of a storage system is as follows: logical volumes are created, and when created, each logical volume is allocated physical storage space, which may be the disk composition of a certain storage device or of several storage devices. The client stores data on a certain logical volume, that is, stores the data on a file system, the file system divides the data into a plurality of parts, each part is an object, the object includes not only the data but also additional information such as data identification (ID, ID entry), the file system writes each object into a physical storage space of the logical volume, and the file system records storage location information of each object, so that when the client requests to access the data, the file system can allow the client to access the data according to the storage location information of each object. The process of allocating physical storage space for the logical volume by the storage system specifically includes: physical storage space is pre-partitioned into stripes according to a set of capacity measures of objects stored in the logical volumes (which often have a large margin with respect to the capacity of the actual objects to be stored) and Redundant Array of Independent Disks (RAID), and a logical volume can be understood as a stripe, thereby allocating physical storage space to the logical volume.
2) A parameter, also called a parameter variable, is a variable. Parameters are an option available for many machine settings or repairs, literally understood to be data that may be referenced, but sometimes not all. It may be an assigned constant value for a given application; when broadly referred to, it can be a variable that controls other quantities that vary as a function of its variation.
3) The service can be a static program, and the service can be a front-end service (operated by the terminal) or a background service (operated by the server).
4) The service process may be an execution process of a server providing the service, or may be a service in an execution state, and the service process may occupy resources of the server.
5) The Memory address may be a Memory address (Memory address) which is a number of a Memory location in the Memory. Since the number of memory locations in a memory is large, each memory location needs to be assigned a memory address for performing a lookup.
6) The storage space may refer to a medium required for data storage. The set of physical addresses is called physical space, also called storage space, i.e. the total capacity of a certain storage device, such as 256MB of memory, 128MB of a usb disk, 80GB of a hard disk, etc.
7) Compilation may be a process of generating an object program from a source program written in a source language using a compiler, and may be an action of generating an object program using a compiler. Compiling is to change a high-level language into a 2-system language which can be recognized by a computer, the computer only recognizes 1 and 0, and a compiler program changes a familiar language into a 2-system language. The compiler program translates a source program into a target program and divides the working process into five stages, namely lexical analysis, syntactic analysis, semantic check and intermediate code generation; optimizing codes; and generating an object code. The method mainly comprises the steps of performing lexical analysis and syntactic analysis, namely source program analysis, finding grammatical errors in the analysis process, and giving prompt information. A compiled language is a programming language implemented with a compiler. Unlike the transliteration language, the interpreter operates the codes in a sentence by sentence, but the compiler is used for compiling the codes into machine codes and then operating the machine codes. In theory, any programming language may be compiled, or interpreted. The difference between them is only relevant to the application of the program.
8) The hot update can be an update mode commonly used by numerous apps such as various large handtours. In short, it is the immediate update encountered when opening the APP after the user downloads the installation APP. The hot update is dynamic code issuing, so that a developer can repair errors and release functions without releasing a new version, the developer can bypass an apple audit mechanism, and the cost caused by long-time audit waiting and repeated refusal is avoided.
9) The architecture of X86, The architecture of X86 (The X86 architecture), may be a set of computer language instructions executed by a microprocessor, refers to standard numbering abbreviations for The column of Intel general purpose computers, and also identifies a common set of computer instructions.
10) And the register is a component in the central processing unit. Registers are high-speed memory components of limited storage capacity that may be used to temporarily store instructions, data, and addresses. In the control unit of the central processing unit, registers are included, such as an Instruction Register (IR) and a Program Counter (PC). In the arithmetic and logic part of the central processor, the registers have Accumulators (ACC). A register, a very important type of memory cell in an integrated circuit, is usually composed of flip-flops. In integrated circuit design, registers can be divided into two categories, registers used inside the circuit and registers that serve as internal and external interfaces. The internal registers are not accessible by external circuitry or software, but merely serve to implement a memory function for the internal circuitry or to meet timing requirements for the circuitry. The interface register can be accessed by an internal circuit and an external circuit or software at the same time, and the register in the CPU is one of the interfaces of the software and the hardware and is well known by a wide range of general programming users. Registers are elements internal to the CPU, including general purpose registers, special purpose registers, and control registers. Registers have very high read and write speeds, so data transfer between registers is very fast.
In order to better understand the method provided in the embodiment of the present application, a service update method in the related art is first described:
with the continuous development of network technology, the intelligent client becomes the main way for users to play games and communicate. However, errors occur occasionally in the service process for providing services for the intelligent terminal, so that the service process cannot provide services for the intelligent client normally. If the error occurred in the service process is not immediately repaired, huge loss is brought to the user and the operator of the intelligent client.
Particularly, in the network game client, the number of players generally targeted by the network game client is large, and may reach the order of millions or even tens of millions. Meanwhile, due to the characteristic of fast update iteration of the online game, some logic errors inevitably occur in the service process for providing services for the online game. Some of these logic failures are tolerable, some are of great impact and must be repaired immediately. If the repair is not performed in time, the service process is stopped, and the service cannot be provided for the online game client, which is commonly called as service halt. There is data indicating that a game, once temporarily taken out of service, adversely affects the number of active players of the game, and therefore, logical faults that exist in the service process must be repaired in a timely manner.
The traditional way of repairing a service process faces a number of problems: on one hand, the user experience is affected, and in the fault repairing process, the service process is suspended, so that a user cannot normally use the client during repairing, and the user experience is seriously affected during fault repairing. On the other hand, the problem that the repair process is tedious, complex and long in time consumption is solved, in the prior art, after the fault is repaired, the codes of the whole service process need to be completely compiled again, and for a client with a huge code scale, the client can stay for a long time in the compiling process, so that the repair process is tedious and long in time consumption, the online fault cannot be solved at the first time, and the user experience is continuously reduced.
The method, the apparatus, and the computer-readable storage medium for updating a service provided in an embodiment of the present application can repair an error of a service process without affecting user experience, and an exemplary application of an electronic device for updating a service provided in an embodiment of the present application is described below. In the following, an exemplary application will be explained when the device is implemented as a server.
Referring to fig. 1, fig. 1 is a schematic architecture diagram of an update system 100 for a service provided by an embodiment of the present application, in order to implement an update application supporting a service, a terminal (illustratively, a terminal 400-1, a terminal 400-2, and a terminal 401) is connected to a server 200 through a network 300, and the network 300 may be a wide area network or a local area network, or a combination of the two.
Terminal 400-1 and terminal 400-2 are configured for use by a user of the client for display on graphical interface 410 (graphical interface 410-1 and graphical interface 410-2 are shown as examples). The terminal 401 is configured to transmit the patch file to the server 200. The server 200 serves the terminals 400-1 and 400-2 and loads a patch file to repair the existing failure.
When a service process in the server 200 fails, the server 200 informs the terminal 401 of a failure message through the network 300, the terminal 401 may generate a corresponding patch file for repairing the failure and send the patch file to the server 200, the server 200 obtains the patch file corresponding to the failure and a start address of a failure function, analyzes an address of a logic repair function in the patch file by loading the patch file by the service process, writes an operation instruction from the start address of the failure function, writes the address of the logic repair function into a register, and makes the service process jump to the address of the logic repair function when executing the failure function to execute the logic repair function, thereby repairing the logic failure of the service process. And repairing the data fault generated by the fault function by executing the data repair function in the patch file.
In the process of performing fault repair on the server 200, the server 200 can normally provide services for the APPs in the terminal 400-1 and the terminal 400-2, and when a user uses the AP P through the terminal 400-1 and the terminal 400-2, the user cannot be influenced by normal use of the APPs through the terminal 400-1 and the terminal 400-2 due to fault repair in a service process, so that user experience is effectively improved.
In some embodiments, the server 200 may be an independent physical server, may also be a server cluster or a distributed system formed by a plurality of physical servers, and may also be a cloud server providing basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a network service, cloud communication, a middleware service, a domain name service, a security service, a CDN, and a big data and artificial intelligence platform. The terminal 400-1, the terminal 400-2, and the terminal 401 may be, but are not limited to, a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, and the like. The terminal and the server may be directly or indirectly connected through wired or wireless communication, and the embodiment of the present application is not limited.
Referring to fig. 2, fig. 2 is a schematic structural diagram of a server of an update method for a service provided by an embodiment of the present application, and an electronic device 400 shown in fig. 2 includes: at least one processor 410, memory 450, at least one network interface 420, and a user interface 430. The various components in electronic device 400 are coupled together by a bus system 440. It is understood that the bus system 440 is used to enable communications among the components. The bus system 440 includes a power bus, a control bus, and a status signal bus in addition to a data bus. For clarity of illustration, however, the various buses are labeled as bus system 440 in fig. 2.
The Processor 410 may be an integrated circuit chip having Signal processing capabilities, such as a general purpose Processor, a Digital Signal Processor (DSP), or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc., wherein the general purpose Processor may be a microprocessor or any conventional Processor, etc.
The memory 450 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid state memory, hard disk drives, optical disk drives, and the like. Memory 450 optionally includes one or more storage devices physically located remote from processor 410.
The memory 450 includes either volatile memory or nonvolatile memory, and may include both volatile and nonvolatile memory. The nonvolatile memory may be a Read Only Memory (ROM), and the volatile memory may be a Random Access Memory (RAM). The memory 450 described in embodiments herein is intended to comprise any suitable type of memory.
In some embodiments, memory 450 is capable of storing data, examples of which include programs, modules, and data structures, or a subset or superset thereof, to support various operations, as exemplified below.
An operating system 451, including system programs for handling various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and handling hardware-based tasks;
a network communication module 452 for communicating to other computing devices via one or more (wired or wireless) network interfaces 420, exemplary network interfaces 420 including: bluetooth, wireless compatibility authentication (WiFi), and Universal Serial Bus (USB), etc.;
in some embodiments, the apparatus provided in the embodiments of the present application may be implemented in software, and fig. 2 illustrates an apparatus 455 stored in the memory 450, which may be software in the form of programs and plug-ins, and the like, and includes the following software modules: a first module 4551 and a second module 4552, which are logical and thus may be arbitrarily combined or further separated depending on the functions implemented. The functions of the respective modules will be explained below.
In other embodiments, the apparatus provided in the embodiments of the present Application may be implemented in hardware, and as an example, the apparatus provided in the embodiments of the present Application may be a processor in the form of a hardware decoding processor, which is programmed to perform the method for updating the service provided in the embodiments of the present Application, for example, the processor in the form of the hardware decoding processor may be one or more Application Specific Integrated Circuits (ASICs), DSPs, Programmable Logic Devices (PLDs), Complex Programmable Logic Devices (CPLDs), Field Programmable Gate Arrays (FPGAs), or other electronic components.
The following describes an embodiment of the present application by taking an example in which the server 200 in fig. 1 implements an update method of a service provided in the embodiment of the present application. Referring to fig. 3, fig. 3 is a schematic flowchart of a service updating method provided by an embodiment of the present application, and will be described with reference to the steps shown in fig. 3.
In step 101, when a service process fails, a patch file corresponding to the failure and a start address of a failure function are obtained.
In some embodiments, the service process may be an executing process of a server providing the service. The service can be a server for providing the service, the server can be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, and the service can also be a cloud server for providing basic cloud computing services such as cloud service, a cloud database, cloud computing, cloud functions, cloud storage, network service, cloud communication, middleware service, domain name service, security service, CDN (content distribution network), big data and artificial intelligence platform and the like.
For example, referring to fig. 1, a service process failure is typically caused by an error in some fault function in the service process. The patch file corresponding to the failure can repair the failure generated by the failure function, and therefore, when the service process fails, the server 200 acquires the patch file corresponding to the failure from the terminal 401. The server 200 may detect the starting address of the failed function by detection means.
In some embodiments, the patch file may be a binary file containing a composition of related functions that can address the failure of the service process.
In step 102, the address of the logic repair function in the patch file is resolved by loading the patch file by the service process, wherein the logic repair function is a correct version of the fault function.
In some embodiments, the logical repair function is the correct version of the failure function, that is, the logical repair function may be a function that has the same functionality as the failure function, but the logical repair function is free of logical errors that the failure function has. It is understood that if the error existing in the fault function is corrected, the fault function having no logical error may be a logical repair function.
After the server acquires the patch file, the address of the logic repair function in the patch file is analyzed in a mode of enabling the service process to load the patch file.
In some embodiments, the patch file may include the logical repair function and an address of a storage space where the logical repair function is located.
In step 103, an operation instruction is written from the start address of the fault function, wherein the operation instruction is used for writing the address of the logic repair function into the register and making the service process jump to the address of the logic repair function when executing the fault function so as to execute the logic repair function.
Here, the server may write a corresponding operation instruction into an address after the start address from the start address of the address space where the fault function in the service process is located, and the operation instruction may write the address of the logic repair function into the register and cause the service process to jump to the address of the logic repair function when executing the fault function to execute the logic repair function.
In some embodiments, the operational instructions may refer to instructions issued by a machine language. For example, in MCS-51, there may be one-byte instructions, two-byte instructions, etc. generally, divided by the bytes occupied by the instructions; there may typically be one machine cycle of instructions, two machine cycle of instructions, etc., depending on the execution time of the instructions. The specific type of the operation instruction may be different operation instructions according to different system architectures, and the specific type of the operation instruction does not limit the present invention.
Here, the operation instructions are on Central Processing Units (CPUs) of different architectures, and the operation instructions may be different, but on CPUs of different architectures, the operation instructions may each write an address of the logical repair function into a register and cause the service process to jump to the address of the logical repair function when executing the fault function to execute the logical repair function. It is to be understood that the specific type of operational instructions is not to be construed as limiting the application.
Here, the register may be a general-purpose register, and the general-purpose register may be a RAX register, which may be used as a function return value. And then the address of the logic repair function can be written into the RAX register through the operation instruction, and the service process jumps to the address of the logic repair function when the fault function is executed.
Here, it is understood that, by writing the operation instruction at the start address of the fault function, for example, referring to fig. 1, when the server 200 provides the terminal 400-1 with a service, it is found that there is a fault, and then the operation instruction may be written from the start address of the fault function, and when the server 200 provides the same service to the terminal 400-2 for the second time, the service process jumps to the address of the logical repair function to execute the logical repair function when executing the fault function. Thereby providing the correct, non-faulty service to the terminal 400-1 or 400-2 by performing a logical repair function.
Step 105 may also be performed prior to step 103. In step 105, a system interface function is called to assign a writable right to a specific length of memory space starting from the start address of the failed function.
Here, the system interface function may refer to an mprotect function, and the mprotect function may modify a protection attribute of a memory page of the calling process, and specifically, an expression of the mprotect function may be:
mprotect(void*addr,size_t len,int prot)
wherein addr represents the initial address of the modified protection attribute region; len represents the length of the modified protection attribute region; prot may take different parameters to modify different functions of the protection attribute region.
Here, the specific length may be the length of the modified protection attribute region, typically an integer multiple of the page size (typically 4KB to 4096 bytes).
The above step 105 can also be realized by the step 1051. In step 1051, a writable right is given to a specific length of storage space starting from a start address of the fault function by calling a first parameter included in the system interface function, wherein the first parameter is used to make the content in the specific length of storage space writable.
Here, the first parameter may refer to prot _ write, which may make the contents in a storage space of a certain length writable.
In step 104, the data fault generated by the fault function is repaired by executing the data repair function in the patch file.
Here, for example, referring to fig. 1, when the server 200 provides a service to the terminal 400-1, it is found that there is a fault, and the fault function is already running, and the fault function that has already run may generate fault data, that is, there is a data fault in the service process at this time. Furthermore, the data failure generated by the failure function can be repaired by executing the data repair function in the patch file.
After step 104, step 106 may also be performed. In step 106, the writeable right is revoked for a specific length of memory space starting from the start address of the failed function by calling the system interface function.
Here, the system interface function may refer to an mprotect function, and the mprotect function may modify a protection attribute of a memory page of the calling process, and specifically, an expression of the mprotect function may be:
mprotect(void*addr,size_t len,int prot)
wherein addr represents the initial address of the modified protection attribute region; len represents the length of the modified protection attribute region; prot may take different parameters to modify different functions of the protection attribute region.
Here, the specific length may be the length of the modified protection attribute region, typically an integer multiple of the page size (typically 4KB — 4096 bytes).
Here, in different system architectures, different system interfaces may be provided, and the mprotect function is only an exemplary illustration and is not to be construed as a limitation of the present invention.
Here, the method cancels the writable right for the memory space with the specific length from the starting address of the fault function, so that the method can prevent that the memory space with the specific length from the starting address of the fault function is damaged by the boundary-crossing error possibly existing in other positions in the process, and if the boundary-crossing error occurs, the more serious error can be caused.
Step 106 described above may also be implemented by step 1061. In step 1061, by calling a second parameter included in the system interface function, the writable right is canceled for the specific-length storage space starting from the starting address of the failed function; wherein the second parameter is used to make the content in the storage space of the specific length unwritable.
In some embodiments, referring to fig. 4, fig. 4 is a flowchart illustrating a method for updating a service provided in an embodiment of the present application, and step 103 may be implemented by step 1031 to step 1032 shown in fig. 4, which will be described with reference to the steps.
The operation instruction comprises a data transmission instruction and a jump instruction;
in step 1031, a data transfer instruction is written starting from the start address of the fault function, wherein the data transfer instruction is used to write the address of the logical repair function into the register.
Here, the data transfer instruction may be referred to as a mov (move) instruction, and the transfer instruction mov (move) indicates that a byte, word or double word operand is transferred from a source location to a destination location, with the contents of the source operand unchanged. The address of the logical repair function may be written to the RAX register by a MOV (move) instruction.
Here, the data transfer instruction is written from the start address of the fault function, and the address of the logical repair function may be written into the register, so that the corresponding logical repair function may be found from the fault function later when the fault function is executed.
Here, the steps may be a linux system running on an x86 and x86-64 architecture, or an architecture thereof, such as an ARM, or other operating systems, such as windows, android, etc., which may implement the functions to be implemented by the method of the present invention, and the specific type of the operation instruction is not limited to the present invention.
Here, the step 1031 may be implemented by the following sub-step one.
In sub-step one, a data transfer instruction including an address of the logical repair function is written starting from a start address of the fault function, wherein the data transfer instruction is used to write the address of the logical repair function to the register.
Here, the above-described substep one may be realized by the following substep two.
In sub-step two, a data transfer instruction including a specific address and an address of a logical repair function is written starting from the start address of the fault function, the specific address being an address having an offset from the start address of the fault function.
Here, the operands in the data transfer instruction include a source data value and a destination address, the source data value may be an immediate, a register, and a memory address, and the destination address may include a register and a memory address. Meanwhile, the source data value and the destination address cannot be memory addresses at the same time. It will be appreciated that the particular address and the address of the logical repair function may be used as the source data value or destination address to write the address of the logical repair function to the register.
Here, the numerical value of the specific address may be a hexadecimal number of two bytes, and specifically, the specific values of the hexadecimal number of two bytes may be \ x48 and \ xb 8.
In step 1032, the write jump instruction is continued after the write data transfer instruction, wherein the jump instruction is used for causing the service process to jump to the address of the logic repair function when executing the fault function so as to execute the logic repair function.
Here, a jump instruction (jump instruction) is a type of instruction that changes the execution order of a program, and the jump instruction can cause a process to jump to a specified position unconditionally and start executing an instruction of a new position.
Here, after the data transfer instruction is written from the start address of the fault function, the address of the logical repair function has been written into the register, and then the write jump instruction is continued, so that the service process jumps to the address of the logical repair function when executing the fault function to execute the logical repair function.
Here, the jump instruction may include a two-byte hexadecimal number, and the two-byte hexadecimal number included in the jump instruction may be \ xff and \ xe 0.
In some embodiments, referring to fig. 5, fig. 5 is a flowchart illustrating a method for updating a service provided by an embodiment of the present application, and before step 101, referring to fig. 5, step 110 and step 120 may also be performed.
In step 110, a repair file for repairing the failure is generated according to the failure function.
Here, for example, referring to fig. 1, the terminal 401 may generate a repair file for repairing the failure according to the failure function.
In step 120, the repair file is compiled to obtain a patch file corresponding to the failure.
Here, referring to fig. 1, the terminal 401 may further perform compiling processing on the repair file to obtain a patch file corresponding to the failure.
Here, the compiling process may be to change a high-level language into a 2-system language that can be recognized by a computer, the computer recognizes only 1 and 0, and the compiler changes a language that is familiar to people into 2-system. The compiler program translates a source program into a target program and has five stages: lexical analysis; analyzing the grammar; semantic checking and intermediate code generation; optimizing codes; and generating an object code. The method mainly comprises the steps of performing lexical analysis and syntactic analysis, namely source program analysis, finding grammatical errors in the analysis process, and giving prompt information. A compiled language is a programming language implemented in a compiler. Unlike the transliteration language, the interpreter operates the codes in a sentence by sentence, but the compiler is used for compiling the codes into machine codes and then operating the machine codes.
Here, it is understood that the repair file may be a high-level language before compilation, and the patch file may be a binary patch file after compilation.
In some embodiments, referring to fig. 6, fig. 6 is a flowchart illustrating a method for providing an update of a service according to an embodiment of the present application, and based on fig. 6, step 110 may further perform step 111 and step 112.
In step 111, a logical repair function for repairing the logical failure is generated based on the logical failure.
Here, for example, referring to fig. 1, the terminal 401 may generate a logical repair function for repairing the logical failure according to the logical failure.
In step 112, a data repair function for repairing the data failure is generated based on the data failure.
Here, for example, referring to fig. 1, the terminal 401 may generate a data repair function for repairing the data failure according to the data failure.
Continuing with fig. 2, an exemplary structure of the service updating apparatus 455 provided by the embodiment of the present application implemented as software modules is described below, and in some embodiments, as shown in fig. 2, the software modules stored in the service updating apparatus 455 of the memory 450 may include: an obtaining module 4551, an analysis module 4552, a first repairing module 4553, and a second repairing module 4554.
An obtaining module 4551, configured to, when a service process fails, obtain a patch file corresponding to the failure and an initial address of a failure function;
the parsing module 4552 is configured to parse an address of a logic repair function in the patch file in a manner that the service process loads the patch file, where the logic repair function is a correct version of the fault function;
a first repair module 4553, configured to write an operation instruction starting from a start address of the fault function, where the operation instruction is configured to write an address of the logical repair function into a register and cause a service process to jump to the address of the logical repair function when the fault function is executed, so as to execute the logical repair function;
and a second repairing module 4554, configured to repair the data failure generated by the failure function by executing the data repairing function in the patch file.
In some embodiments, the first repair module 4553 is further configured to write a data transfer instruction starting from a start address of the fault function, wherein the data transfer instruction is configured to write an address of the logical repair function to the register; and continuing to write a jump instruction after writing the data transmission instruction, wherein the jump instruction is used for causing the service process to jump to the address of the logic repair function when executing the fault function so as to execute the logic repair function.
In some embodiments, the first repair module 4553 is further configured to write a data transfer instruction including an address of the logical repair function starting from the start address of the malfunction function, wherein the data transfer instruction is configured to write the address of the logical repair function to the register.
In some embodiments, the first repair module 4553 is further configured to write, starting from the start address of the fault function, a data transfer instruction including a specific address and an address of the logical repair function, the specific address being an address having an offset from the start address of the fault function.
In some embodiments, the updating means of the service further comprises: the generating module is used for generating a repair file for repairing the fault according to the fault function; and the compiling module is used for compiling the repaired file to obtain a patch file corresponding to the fault.
In some embodiments, the generating module is further configured to generate a logic repair function for repairing the logic failure according to the logic failure; and generating a data repair function for repairing the data failure according to the data failure.
In some embodiments, the updating means of the service further comprises: the first permission module is used for endowing writable permission to the storage space with the specific length from the initial address of the fault function by calling the system interface function.
In some embodiments, the updating means of the service further comprises: and the second permission module is used for canceling the writable permission from the storage space with the specific length starting from the initial address of the fault function by calling the system interface function.
In some embodiments, the first permission module is further configured to assign a writable permission to the memory space of the specific length starting from the starting address of the fault function by calling a first parameter included in the system interface function; wherein the first parameter is used to make the content in the storage space of the specific length writable.
In some embodiments, the second permission module is further configured to cancel the writable permission for the storage space of the specific length starting from the start address of the failed function by calling a second parameter included in the system interface function; wherein the second parameter is used to make the content in the storage space of the specific length unwritable.
Next, an exemplary application of the embodiment of the present application in a practical application scenario will be described.
In the implementation process of the embodiment of the application, the following problems are found in the related art:
(1) the related art is based on a batch updating scheme of clustered deployment, which requires that a plurality of services providing the same function are deployed at the same time, and one or more or all of the services provide service capability to the outside at ordinary times; when updating is needed, the service capability of some of the services is closed through a certain scheduling mode, and the service request of the front end is transferred to other services; at this time, the stopped service is updated and restarted, then the service request of the next batch of service is transferred to the updated service batch, and then the service of the batch is updated and restarted by the same method until all the services are completely updated.
The disadvantages of this solution are mainly three: firstly, higher requirements are put forward on the design and development of a program, a service with clustering deployment capability needs to be designed independently, and according to different specific logics, some services are difficult to provide clustering deployment capability, so that higher requirements are put forward on developers, and the development efficiency is reduced; secondly, the same function deploys a plurality of services, which will increase the requirements for hardware (such as memory, CPU and disk); thirdly, the whole updating process is relatively long and complex, a special service scheduling flow is needed, and the process is easy to make mistakes.
(2) Summary schemes based on shared memory in the related art. The scheme requires that all running data of the program is placed in the shared memory, when the program logic needs to be updated, the process is shut down firstly, then the new program is started in the abstract mode, and the new program starting process is re-associated to the shared memory created by the shutdown process before, so that the running state of the service is completely reserved, and the service logic is updated.
The disadvantages of this solution are mainly two-fold: firstly, the invasiveness of the development mode is enhanced, and the scheme needs to be considered and compatible at the beginning of programming, so that the burden of programming and development is increased; secondly, the scheme requires that all pointers related to the shared memory data need to be recalculated after the new process is re-associated to the shared memory, the recalculated logic can only be manually written during program development, and the process is easy to crash once missing, so that the instability of service operation is increased.
(3) Dynamic library approaches in the related art. The scheme requires different function modules of the program to be compiled into independent dynamic libraries, and all the dynamic libraries are loaded into a process when the program is started; when the logic of a certain functional module needs to be updated, the original dynamic library needs to be unloaded first, and then a new dynamic library needs to be loaded.
The main drawbacks of this solution are: if there is a symbolic reference relationship between the core portion of the program and a dynamic library or between different dynamic libraries, reloading the dynamic libraries may cause reference failures, thereby causing process runtime errors and even crashes. Therefore, during program development, it is necessary to ensure that the symbol referenced by the dynamic library does not appear outside the library, or the address of the symbol is recalculated after a new dynamic library is loaded, which also puts certain requirements on program design and development, and increases the burden of developers.
(4) In the related technology, code logic is updated, a binary file of a generated program is recompiled, a code segment of a repair logic in the binary file is extracted to generate a patch file, and then the patch file is loaded to a code segment of a process address space by a process during operation; and modifying the entry instruction of the old function (function to be repaired), and adding an instruction for jumping to the new function (repaired function), so that when the program is executed to the old function, the program actually jumps to the execution of the new function.
The main drawbacks of this solution are: after the codes are modified, the whole codes need to be completely compiled, and binary files of the programs need to be regenerated, so that the process is longer for projects with larger code sizes, and the time for solving the online problems is delayed; on the other hand, the process loads the patch file to the specified position of the memory, the mechanism is not in the standard updating method provided by c/c + +, and the process cannot automatically analyze the global symbols referred to in the patch file; therefore, if the patch file (extracted in the binary file of the new program) is not compatible with the old program, it will not be possible to find the error at the first time the patch file is loaded, which may subsequently lead to a serious error; finally, this scheme fails to fix data errors in the process.
In view of the above problems, an embodiment of the present application provides a service updating method, in which a service process loads a patch file including a data repair function and a logic repair function, an operation instruction is written into a start address of a fault function, and when the service process executes the fault function, the service process jumps to execute the logic repair function, so that the service process is prevented from executing the fault function having a fault. The logic repair function is the correct version of the fault function, so that the service process is ensured to provide the correct logic function for the user while the service process is prevented from executing the fault function with the fault, and the effect of repairing the logic fault of the service process is achieved. Meanwhile, the data fault generated by the fault function is repaired in a mode of executing the data repair function in the patch file. Therefore, the service process can be repaired from logic errors and data errors without influencing the user experience.
Fig. 7 is a flowchart illustrating a method for providing an update of a service according to an embodiment of the present application, and referring to fig. 7, an implementation of the embodiment of the present application is as follows:
for example, in an actual network game service scenario, the network game service is usually oriented to a large number of players, and the number of users of a popular network game may reach millions or even millions. Because the updating iteration speed of the online game is high, some faults occur inevitably occasionally. Some of the faults do not affect the user experience obviously, but some of the faults affect the user experience obviously, so that the faults must be repaired as soon as possible, otherwise the user experience is seriously affected, and even the whole online game is interrupted in a more serious condition, which is colloquially called out-of-service. Supposing that once an online game is temporarily stopped, the experience of an online game user is seriously adversely affected, so that the implementation scheme of the embodiment of the application can be as follows:
referring to fig. 1 and fig. 7 of the present application, when the server 200 fails, an implementation of the embodiment of the present application may specifically include the following steps:
step 701, according to the logic fault, generating a logic repair function for repairing the logic fault.
Step 702, according to the data failure, generating a data repair function for repairing the data failure.
And 703, compiling the repaired file to obtain a patch file corresponding to the fault.
Step 704, when the service process fails, the patch file corresponding to the failure and the start address of the failure function are obtained.
Step 705, analyzing the address of the logic repair function in the patch file by enabling the service process to load the patch file, wherein the logic repair function is a correct version of the fault function.
And step 706, assigning a writable right to the storage space with the specific length from the start address of the fault function by calling a first parameter included in the system interface function, wherein the first parameter is used for making the content in the storage space with the specific length writable.
Step 707, a data transfer instruction is written starting from the start address of the fault function, wherein the data transfer instruction is used to write the address of the logical repair function to the register.
And step 708, continuing to write a jump instruction after writing the data transmission instruction, wherein the jump instruction is used for enabling the service process to jump to the address of the logic repair function when executing the fault function so as to execute the logic repair function.
Step 709, the data fault generated by the fault function is repaired by executing the data repair function in the patch file.
Step 710, canceling a writable right for a storage space with a specific length starting from the initial address of the fault function by calling a second parameter included in the system interface function; wherein the second parameter is used to make the content in the storage space of the specific length unwritable.
Fig. 8 is a flowchart illustrating a method for providing an update of a service according to an embodiment of the present application, and referring to fig. 8, an implementation of the embodiment of the present application is as follows:
it will be appreciated that the above embodiments are exemplary of the server-based update. Referring to fig. 8, in the method for providing service update according to the embodiment of the present application shown in fig. 8, in order to perform compilation with a server and then deliver to a terminal, a method for performing service update in a terminal 401 is provided.
In step 801, the server 200 generates a logic repair function for repairing the logic failure according to the logic failure.
In step 802, the server 200 generates a data repair function for repairing the data failure according to the data failure.
In step 803, the server 200 compiles the repair file to obtain a patch file corresponding to the failure.
Step 804, server 200 sends patch file to terminal 401
In step 805, when the service process fails, the terminal 401 acquires a patch file corresponding to the failure and an initial address of a failure function.
In step 806, the terminal 401 resolves the address of the logic repair function in the patch file by loading the patch file by the service process, where the logic repair function is the correct version of the fault function.
In step 807, the terminal 401 assigns a writable right to the specific-length storage space starting from the start address of the fault function by calling a first parameter included in the system interface function, where the first parameter is used to make the content in the specific-length storage space writable.
In step 808, the terminal 401 writes a data transfer instruction starting from the start address of the fault function, wherein the data transfer instruction is used to write the address of the logical repair function into the register.
In step 809, the terminal 401 continues to write the jump instruction after writing the data transmission instruction, where the jump instruction is used to make the service process jump to the address of the logical repair function when executing the fault function, so as to execute the logical repair function.
In step 810, the terminal 401 repairs the data failure generated by the failure function by executing the data repair function in the patch file.
Step 811, the terminal 401 cancels the writable right for the specific length storage space starting from the start address of the fault function by calling the second parameter included in the system interface function; wherein the second parameter is used to make the content in the storage space of the specific length unwritable.
In summary, the embodiment of the present application has the following beneficial effects:
(1) by loading the patch file comprising the data repair function and the logic repair function by the service process, the operation instruction is written in the initial address of the fault function, and when the service process executes the fault function, the service process jumps to execute the logic repair function, thereby avoiding the service process from executing the fault function with faults. The logic repair function is the correct version of the fault function, so that the service process is ensured to provide the correct logic function for the user while the service process is prevented from executing the fault function with the fault, and the effect of repairing the logic fault of the service process is achieved. Meanwhile, the data fault generated by the fault function is repaired in a mode of executing the data repair function in the patch file. Therefore, the logic errors and the data errors of the service process can be repaired under the condition of not influencing the user experience.
(2) The generated patch file is short and short, the full binary file does not need to be generated in advance and then the patch file is intercepted from the binary file, and the patch file can be independently compiled to be generated to repair the fault in the service process. Because the generated patch file is small, the patch file can be compiled and generated independently by the repair file without compiling the whole program, so that the time consumption of the compiling process is greatly shortened, the time consumption of the repairing process is further shortened, and the capability of solving the emergency online fault is effectively improved.
Embodiments of the present application provide a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and executes the computer instructions, so that the computer device executes the method for updating the service according to the embodiment of the present application.
Embodiments of the present application provide a computer-readable storage medium storing executable instructions, which when executed by a processor, will cause the processor to perform a method provided by embodiments of the present application, for example, an update method of a service as shown in fig. 3.
In some embodiments, the computer-readable storage medium may be memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash, magnetic surface memory, optical disk, or CD-ROM; or may be various devices including one or any combination of the above memories.
In some embodiments, executable instructions may be written in any form of programming language (including compiled or interpreted languages), in the form of programs, software modules, scripts or code, and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.
By way of example, executable instructions may, but need not, correspond to files in a file system, and may be stored in a portion of a file that holds other programs or data, such as in one or more scripts in a hypertext Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files that store one or more modules, sub-programs, or portions of code).
By way of example, executable instructions may be deployed to be executed on one computing device or on multiple computing devices at one site or distributed across multiple sites and interconnected by a communication network.
In summary, in the embodiment of the present application, by loading the patch file including the data repair function and the logic repair function in the service process, the operation instruction is written in the start address of the fault function, so that when the service process executes the fault function, the service process jumps to execute the logic repair function, thereby preventing the service process from executing the fault function having a fault. The logic repair function is the correct version of the fault function, so that the service process is ensured to provide the correct logic function for the user while the service process is prevented from executing the fault function with the fault, and the effect of repairing the logic fault of the service process is achieved. Meanwhile, the data fault generated by the fault function is repaired in a mode of executing the data repair function in the patch file. Therefore, the logic errors and the data errors of the service process can be repaired under the condition of not influencing the user experience. Because the generated patch file is short, the patch file does not need to be generated in advance and then intercepted, and the patch file can be independently compiled to generate the patch file to repair the fault in the service process. Because the generated patch file is small, the patch file can be compiled and generated independently by the repair file without compiling the whole program, so that the time consumption of the compiling process is greatly shortened, the time consumption of the repairing process is further shortened, and the capability of solving the emergency online fault is effectively improved.
The above description is only an example of the present application, and is not intended to limit the scope of the present application. Any modification, equivalent replacement, and improvement made within the spirit and scope of the present application are included in the protection scope of the present application.

Claims (10)

1. A method for updating a service, comprising:
when a service process fails, generating a logic repair function for repairing the logic failure according to the logic failure of the failed fault function; generating a data repair function for repairing the data fault according to the data fault of the fault function of the fault; compiling the logic repair function and the data repair function to obtain a patch file of the fault;
the data fault is used for indicating that the fault function which is already operated has fault data generated when the fault occurs in the service process, and the logic fault is used for indicating that a logic error exists in the fault function;
acquiring a starting address of the fault function;
analyzing the address of a logic repair function in the patch file in a mode of enabling the service process to load the patch file, wherein the logic repair function is a correct version of the fault function;
writing an operation instruction from a starting address of the fault function, wherein the operation instruction is used for writing an address of the logic repair function into a register and making the service process jump to the address of the logic repair function when the fault function is executed so as to execute the logic repair function and repair the logic fault;
and repairing the data fault generated by the fault function in a mode of executing the data repair function in the patch file.
2. The method of claim 1, wherein the operation instructions comprise data transfer instructions and jump instructions;
the writing operation instruction from the starting address of the fault function comprises:
writing the data transfer instruction starting from a starting address of the fault function, wherein the data transfer instruction is used for writing an address of the logic repair function into the register;
continuing to write the jump instruction after writing the data transmission instruction, wherein the jump instruction is used for causing the service process to jump to the address of the logic repair function when executing the fault function so as to execute the logic repair function.
3. The method of claim 2, wherein writing the data transfer instruction starting from the starting address of the fault function comprises:
and writing a data transmission instruction comprising the address of the logic repair function from the starting address of the fault function, wherein the data transmission instruction is used for writing the address of the logic repair function into a register.
4. The method of claim 3, wherein writing the data transfer instruction including the address of the logical repair function starting from the start address of the fault function comprises:
writing a data transfer instruction including a specific address and an address of the logical repair function starting from a start address of the fault function, wherein the specific address is an address having an offset from the start address of the fault function.
5. The method of claim 1,
before the writing the operation instruction from the start address of the fault function, the method further comprises: by calling a system interface function, a writable right is given to a storage space with a specific length from the initial address of the fault function;
after the data fault generated by the fault function is repaired by executing the data repair function in the patch file, the method further includes: and canceling the writable right for the storage space with the specific length from the starting address of the fault function by calling a system interface function.
6. The method of claim 5, wherein the assigning writeable rights to the memory space of the specific length from the start address of the fault function by calling a system interface function comprises:
assigning a writable right to a specific-length storage space starting from a start address of the fault function by calling a first parameter included in a system interface function;
wherein the first parameter is used to make the content in the storage space of the specific length writable.
7. The method of claim 5, wherein said revoking the writable right for a specific length of memory starting from a starting address of the failed function by calling the system interface function comprises:
canceling the writable right for a storage space with a specific length from the starting address of the fault function by calling a second parameter included in a system interface function;
wherein the second parameter is used to make the content in the storage space of the specific length unwritable.
8. An apparatus for updating a service, the apparatus comprising:
the system comprises an acquisition module, a fault detection module and a fault detection module, wherein the acquisition module is used for generating a logic repair function for repairing a logic fault according to the logic fault of a fault function of the fault when a service process fails; generating a data repair function for repairing the data fault according to the data fault of the fault function of the fault; compiling the logic repair function and the data repair function to obtain a patch file of the fault; the data fault is used for indicating that the fault function which is already operated has fault data generated when the fault occurs in the service process, and the logic fault is used for indicating that a logic error exists in the fault function; acquiring a starting address of the fault function;
the analysis module is used for analyzing the address of a logic repair function in the patch file in a mode of loading the patch file by the service process, wherein the logic repair function is a correct version of the fault function;
a first repair module, configured to write an operation instruction from a start address of a memory space where the fault function exists, where the operation instruction is used to write an address of the logic repair function into a register and cause the service process to jump to the address of the logic repair function when executing the fault function, so as to execute the logic repair function to repair the logic fault;
and the second repairing module is used for repairing the data fault generated by the fault function in a mode of executing the data repairing function in the patch file.
9. An electronic device, characterized in that the electronic device comprises:
a memory for storing executable instructions;
a processor for implementing the method of updating a service of any one of claims 1 to 7 when executing executable instructions or computer programs stored in the memory.
10. A computer-readable storage medium storing executable instructions or a computer program, characterized in that the executable instructions, when executed by a processor, implement the method of updating a service of any one of claims 1 to 7.
CN202110604530.7A 2021-05-31 2021-05-31 Service updating method and device and computer readable storage medium Active CN113342389B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110604530.7A CN113342389B (en) 2021-05-31 2021-05-31 Service updating method and device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110604530.7A CN113342389B (en) 2021-05-31 2021-05-31 Service updating method and device and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN113342389A CN113342389A (en) 2021-09-03
CN113342389B true CN113342389B (en) 2022-09-30

Family

ID=77473541

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110604530.7A Active CN113342389B (en) 2021-05-31 2021-05-31 Service updating method and device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN113342389B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113791809B (en) * 2021-11-11 2022-03-04 腾讯科技(深圳)有限公司 Application exception handling method and device and computer readable storage medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105607937B (en) * 2015-12-25 2019-01-18 京信通信系统(中国)有限公司 A kind of hot patch method and apparatus
CN107784230B (en) * 2017-02-16 2019-06-07 平安科技(深圳)有限公司 The restorative procedure and device of page loophole
CN112015491B (en) * 2019-05-30 2022-08-09 华为技术有限公司 Method, device and computer storage medium for realizing function jump
CN110543323A (en) * 2019-09-11 2019-12-06 北京搜狐新动力信息技术有限公司 Application program repairing method and device
CN111666096B (en) * 2020-07-02 2021-03-16 腾讯科技(深圳)有限公司 Hot updating method and device for target application, storage medium and electronic equipment
CN112416395A (en) * 2020-11-19 2021-02-26 建信金融科技有限责任公司 Hot repair updating method and device

Also Published As

Publication number Publication date
CN113342389A (en) 2021-09-03

Similar Documents

Publication Publication Date Title
US8954939B2 (en) Extending a development environment
US9075692B2 (en) Method, device and system for activating on-line patch
US8621279B1 (en) System and method for generating emulation-based scenarios for Error Handling
Döbel et al. Operating system support for redundant multithreading
US9910684B2 (en) Extensible firmware abstraction
US20080022269A1 (en) Method and Apparatus for Building Executable Computer Programs Using Compiled Program Libraries
US8893100B2 (en) Return address optimisation for a dynamic code translator
US10346310B2 (en) Cache block apparatus and methods
CN111176722B (en) Method, device and storage medium for detecting file version of third party library
CN113342389B (en) Service updating method and device and computer readable storage medium
US20080127118A1 (en) Method and system for dynamic patching of software
CN117193882A (en) ELF loading method based on microkernel operating system
CN116484439B (en) Rust language-based safety enhancement model development method and system
US9069900B2 (en) Method for determining whether a machine code instruction of a machine code program is executed in the machine code program
US20100229167A1 (en) Testing operating system isolation using error injection
CN111984329B (en) Boot software standardized generation and execution method and system
US11055202B1 (en) Compilation scheme for tagged global variables
CN109947407B (en) Data acquisition method and device
RU2521265C2 (en) System and method for automatic processing of software system errors
Audsley et al. Portable code: Reducing the cost of obsolescence in embedded systems
CN114253615B (en) Method and device for setting bootstrap program, electronic equipment and storage medium
RU2306597C2 (en) Method for linking (assembling) software
US8555046B2 (en) Computer system and its HW abstraction method
You et al. A static region‐based compiler for the Dalvik virtual machine
Fitzpatrick et al. 𝚍𝚊𝚟𝚘𝚜: a Python" smuggler" for constructing lightweight reproducible notebooks

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