Service writing method and device, electronic equipment and computer readable medium

By querying the consistency of data version numbers of cache and message middleware in the business system, asynchronous business data writing is realized, solving the problem of write failure caused by untimely update of database subtable indexes, and improving the efficiency and reliability of business data writing.

CN119576207APending Publication Date: 2025-03-07JD DIGITS HAIYI INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311146781.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-06
Publication Date
2025-03-07

AI Technical Summary

Technical Problem

In the business system, the index update of the database subtable is not timely, resulting in the failure of writing business data, increasing the pressure on the database server, and may cause the business system to go down.

Method used

By querying whether there is a service write request processing result in the cache, if it does not exist, the result will be generated and synchronized to the message middleware, the cache will be written according to the service identity, and persisted to the database when the data version number is the same.

Benefits of technology

Asynchronous business data writing is realized, shortening the business data writing time, improving the write success rate, and avoiding write failures caused by untimely index updates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119576207A_ABST
    Figure CN119576207A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a service writing method and device, electronic equipment and a computer readable medium. A specific embodiment of the method comprises the following steps: querying whether a service write request processing result corresponding to the service write processing request exists in a current cache or not; in response to the fact that the service write request processing result corresponding to the service write processing request is not queried, generating the service write request processing result corresponding to the service write processing request; writing the service write request processing result into the cache according to a service identifier corresponding to the service write processing request; and in response to determining that the data version number corresponding to the service write request processing result in the message-oriented middleware is consistent with the data version number corresponding to the service write request processing result in the cache, persisting the service write request processing result to a service table in a preset database. The implementation mode is related to cloud computing, the business data can be written asynchronously, and the business data can be written in real time on the premise that database sub-tables do not need to be referenced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present disclosure relate to the computer field, and in particular to a service writing method, device, electronic device, and computer-readable medium. Background Art

[0002] In actual business systems, as the business scale continues to grow, the amount of business table data will also gradually increase. When the amount of business table data reaches a certain amount, if the business data writing involves a large number of index updates, it will often prolong the writing time of business-related data. Once a large number of write actions are encountered, the pressure on the database server will increase sharply, which will further aggravate the instability of the business system, and in severe cases will cause the business system to crash. At present, in order to improve the efficiency of business data writing, the commonly used method is to use vertical or horizontal database and table sharding to improve the efficiency of business data writing.

[0003] However, the above method usually has the following technical problems: when the index of the database table is not updated in time, it is easy to cause the business data to fail to be written.

[0004] The above information disclosed in this Background section is only for enhancement of understanding of the background of the inventive concept and therefore it may contain information that does not form the prior art that is already known in this country to a person of ordinary skill in the art. Summary of the invention

[0005] The content of this disclosure is used to introduce concepts in a brief form, which will be described in detail in the detailed implementation section below. The content of this disclosure is not intended to identify the key features or essential features of the technical solution claimed for protection, nor is it intended to limit the scope of the technical solution claimed for protection.

[0006] Some embodiments of the present disclosure propose a service writing method, apparatus, electronic device, computer-readable medium, and program product to solve the technical problems mentioned in the above background technology section.

[0007] In a first aspect, some embodiments of the present disclosure provide a business writing method, the method comprising: in response to receiving a business write processing request, querying whether there is a business write request processing result corresponding to the above-mentioned business write processing request in the current cache; in response to not finding the business write request processing result corresponding to the above-mentioned business write processing request, generating a business write request processing result corresponding to the above-mentioned business write processing request, and synchronizing the above-mentioned business write request processing result to the corresponding message topic in the message middleware; according to the business identifier corresponding to the above-mentioned business write processing request, writing the above-mentioned business write request processing result to the above-mentioned cache; in response to determining that the data version number corresponding to the business write request processing result in the above-mentioned message middleware is consistent with the data version number corresponding to the above-mentioned business write request processing result in the above-mentioned cache, persisting the above-mentioned business write request processing result to the corresponding business table in the preset database.

[0008] Optionally, the above-mentioned writing of the business write request processing result into the above-mentioned cache includes: adding the business information corresponding to the above-mentioned business write processing request to the above-mentioned business write request processing result; mapping the above-mentioned business identifier and the above-mentioned business write request processing result to generate a mapped business write request processing result; writing the above-mentioned mapped business write request processing result into the above-mentioned cache, and setting the cache expiration time of the above-mentioned mapped business write request processing result.

[0009] Optionally, in the above response to determining that the data version number corresponding to the business write request processing result in the above message middleware is consistent with the data version number corresponding to the above business write request processing result in the above cache, before persisting the above business write request processing result to the corresponding business table in the preset database, the above method also includes: determining whether the data version number corresponding to the business write request processing result in the above message middleware is consistent with the data version number corresponding to the above business write request processing result in the above cache based on the business write request identifier included in the above business write request processing result.

[0010] Optionally, the business write processing request carries a business write request identifier; and the method further includes: querying the cache according to the business write request identifier to obtain a cache query result; in response to determining that the cache query result is empty, querying the preset database to obtain a data query result.

[0011] Optionally, the method further includes: in response to determining that the data query result is empty, re-executing the business write operation of the business write processing request.

[0012] In a second aspect, some embodiments of the present disclosure provide a business writing device, the device comprising: a query unit, configured to, in response to receiving a business write processing request, query whether there is a business write request processing result corresponding to the above business write processing request in the current cache; a generation unit, configured to, in response to not finding the business write request processing result corresponding to the above business write processing request, generate a business write request processing result corresponding to the above business write processing request, and synchronize the above business write request processing result to the corresponding message topic in the message middleware; a writing unit, configured to write the above business write request processing result to the above cache according to the business identifier corresponding to the above business write processing request; a persistence unit, configured to, in response to determining that the data version number corresponding to the business write request processing result in the above message middleware is consistent with the data version number corresponding to the above business write request processing result in the above cache, persist the above business write request processing result to the corresponding business table in a preset database.

[0013] Optionally, the writing unit is further configured to: add the business information corresponding to the above-mentioned business write processing request to the above-mentioned business write request processing result; map the above-mentioned business identifier and the above-mentioned business write request processing result to generate a mapped business write request processing result; write the above-mentioned mapped business write request processing result into the above-mentioned cache, and set the cache expiration time of the above-mentioned mapped business write request processing result.

[0014] Optionally, before the writing unit, the business writing device also includes: a determination unit, configured to: determine whether the data version number corresponding to the business write request processing result in the above-mentioned message middleware is consistent with the data version number corresponding to the above-mentioned business write request processing result in the above-mentioned cache based on the business write request identifier included in the above-mentioned business write request processing result.

[0015] Optionally, the above service write processing request carries a service write request identifier.

[0016] Optionally, the business writing device also includes: a first query unit, configured to query the above-mentioned cache according to the above-mentioned business write request identifier to obtain a cache query result; a second query unit, configured to query the above-mentioned preset database in response to determining that the above-mentioned cache query result is empty to obtain a data query result.

[0017] Optionally, the business writing device further includes: a re-writing unit configured to re-execute the business writing operation of the business writing processing request in response to determining that the data query result is empty.

[0018] In a third aspect, some embodiments of the present disclosure provide an electronic device comprising: one or more processors; a storage device on which one or more programs are stored, and when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any implementation manner of the above-mentioned first aspect.

[0019] In a fourth aspect, some embodiments of the present disclosure provide a computer-readable medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the method described in any implementation manner of the above-mentioned first aspect is implemented.

[0020] In a fifth aspect, some embodiments of the present disclosure provide a computer program product, including a computer program, which implements the method described in any implementation manner of the above-mentioned first aspect when executed by a processor.

[0021] The above-mentioned various embodiments of the present disclosure have the following beneficial effects: through the business writing method of some embodiments of the present disclosure, the business data writing time is shortened and the business data writing success rate is improved. Specifically, the reason for the failure of business data writing is that the index update of the database sub-table is not timely. Based on this, the business writing method of some embodiments of the present disclosure, first, in response to receiving a business write processing request, inquire whether there is a business write request processing result corresponding to the above business write processing request in the current cache. Thus, it is convenient to write asynchronous business data when the business write request processing result corresponding to the above business write processing request is not included in the cache. Then, in response to not querying the business write request processing result corresponding to the above business write processing request, generate the business write request processing result corresponding to the above business write processing request, and synchronize the above business write request processing result to the corresponding message topic in the message middleware. Thus, when the business write request processing result corresponding to the above business write processing request is not included in the cache, asynchronous processing of business data is realized. Then, according to the business identifier corresponding to the above business write processing request, the above business write request processing result is written to the above cache. Finally, in response to determining that the data version number corresponding to the business write request processing result in the message middleware is consistent with the data version number corresponding to the business write request processing result in the cache, the business write request processing result is persisted to the corresponding business table in the preset database. In this way, business data can be written asynchronously and in real time without referencing the database sub-table. Thus, the business data writing time is shortened and the business data writing success rate is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that components and elements are not necessarily drawn to scale.

[0023] Figure 1 is an architectural diagram of an exemplary system in which some embodiments of the present disclosure may be applied;

[0024] Figure 2 is a flow chart of some embodiments of the business writing method according to the present disclosure;

[0025] Figure 3 are flow charts of other embodiments of the service writing method according to the present disclosure;

[0026] Figure 4 is a schematic diagram of the structure of some embodiments of the service writing device according to the present disclosure;

[0027] Figure 5 It is a schematic diagram of the structure of an electronic device suitable for implementing some embodiments of the present disclosure. DETAILED DESCRIPTION

[0028] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments set forth herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0029] It should also be noted that, for ease of description, only the parts related to the invention are shown in the drawings. In the absence of conflict, the embodiments and features in the embodiments of the present disclosure can be combined with each other.

[0030] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0031] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0032] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0033] The present disclosure will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.

[0034] Figure 1 An exemplary system architecture 100 is shown to which a service writing method or a service writing device according to some embodiments of the present disclosure can be applied.

[0035] like Figure 1 As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0036] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, 103, such as web browser applications, cluster task management applications, search applications, instant messaging tools, email clients, social platform software, etc.

[0037] Terminal devices 101, 102, 103 can be hardware or software. When terminal devices 101, 102, 103 are hardware, they can be various electronic devices with display screens and supporting information display, including but not limited to smart phones, tablet computers, e-book readers, laptop portable computers and desktop computers, etc. When terminal devices 101, 102, 103 are software, they can be installed in the electronic devices listed above. It can be implemented as multiple software or software modules for providing distributed services, for example, or it can be implemented as a single software or software module. No specific limitation is made here.

[0038] The server 105 may be a server that provides various services, such as a background server that provides support for information displayed on the terminal devices 101, 102, and 103. The background server may analyze and process the received request and other data, and feed back the processing results to the terminal device.

[0039] It should be noted that the service writing method provided in the embodiment of the present disclosure can be executed by the terminal devices 101, 102, 103, or by the server 105. Accordingly, the service writing device can be set in the terminal devices 101, 102, 103, or in the server 105. No specific limitation is made here.

[0040] It should be noted that the server can be hardware or software. When the server is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or it can be implemented as a single server. When the server is software, it can be implemented as multiple software or software modules for providing distributed services, or it can be implemented as a single software or software module. No specific limitation is made here.

[0041] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to the implementation requirements.

[0042] Continue to refer Figure 2 , shows a process 200 of some embodiments of the service writing method according to the present disclosure. The service writing method comprises the following steps:

[0043] Step 201: In response to receiving a service write processing request, query whether there is a service write request processing result corresponding to the service write processing request in the current cache.

[0044] In some embodiments, the execution subject of the business writing method (for example, Figure 1 The terminal device shown in the figure) can respond to receiving a business write processing request and query whether there is a business write request processing result corresponding to the above-mentioned business write processing request in the current cache. Here, the business write processing request may refer to a request to write business data. For example, a business write processing request may refer to a request to write business data to the cache. For example, business data may refer to business information of an acquiring business / order business. For example, the business data may be the order information of a user, and the corresponding business write request processing result may refer to the result of order information processing (for example, the items corresponding to the order information have been shipped, including the shipping order number, shipping warehouse, shipping time and other information). The current cache can cache the processed business write request processing results. For example, the identifier of the business corresponding to the business write processing request can be used to query in the current cache whether there is a business write request processing result corresponding to the identifier.

[0045] Step 202, in response to not finding a business write request processing result corresponding to the business write processing request, generate a business write request processing result corresponding to the business write processing request, and synchronize the business write request processing result to the corresponding message topic in the message middleware.

[0046] In some embodiments, the above-mentioned execution subject may generate a business write request processing result corresponding to the above-mentioned business write processing request in response to the failure to find the business write request processing result corresponding to the above-mentioned business write processing request, and synchronize the above-mentioned business write request processing result to the corresponding message topic in the message middleware. That is, the above-mentioned execution subject may process the business corresponding to the above-mentioned business write processing request to generate a business write request processing result. For example, when the business corresponding to the above-mentioned business write processing request is order information, the goods corresponding to the order information are shipped. When the business corresponding to the above-mentioned business write processing request is an acquiring business, acquiring processing is performed.

[0047] That is, the execution subject can synchronize the processing result of the business write request to the corresponding message topic in the message middleware in the form of a message body (MQ message). The message middleware can be a pre-set message middleware. The message topic can be a topic corresponding to a certain business.

[0048] Step 203: Write the processing result of the business write request into the cache according to the business identifier corresponding to the business write processing request.

[0049] In some embodiments, the execution subject may write the processing result of the business write request into the cache according to the business identifier corresponding to the business write processing request. Here, the business identifier corresponding to the business write processing request may refer to the identifier of the business corresponding to the business write processing request, which may uniquely represent the business. In practice, first, the business identifier and the processing result of the business write request may be combined into business write request processing information. Then, the business write request processing information may be written into the cache.

[0050] In some optional implementations of some embodiments, the execution subject may write the service write request processing result into the cache through the following steps:

[0051] The first step is to add the business information corresponding to the business write processing request to the business write request processing result. The business information corresponding to the business write processing request may refer to specific information of the business.

[0052] The second step is to map the service identifier with the service write request processing result to generate a mapped service write request processing result. That is, the service identifier can be associated with the service write request processing result.

[0053] The third step is to write the mapping service write request processing result into the cache and set the cache expiration time of the mapping service write request processing result. The cache expiration time may refer to the longest cache time of the mapping service write request processing result in the cache.

[0054] Optionally, based on the business write request identifier included in the business write request processing result, it is determined whether the data version number corresponding to the business write request processing result in the message middleware is consistent with the data version number corresponding to the business write request processing result in the cache.

[0055] In some embodiments, the execution subject may determine whether the data version number corresponding to the business write request processing result in the message middleware is consistent with the data version number corresponding to the business write request processing result in the cache, based on the business write request identifier included in the business write request processing result. Here, the data version number corresponding to the business write request processing result may be a version number that identifies the business write request processing result. That is, first, the corresponding business write request processing result in the message middleware and the corresponding business write request processing result in the cache may be queried separately through the business write request identifier. Then, determine whether the data version number corresponding to the business write request processing result in the message middleware is the same as the data version number corresponding to the business write request processing result in the cache.

[0056] Step 204, in response to determining that the data version number corresponding to the business write request processing result in the above message middleware is consistent with the data version number corresponding to the business write request processing result in the above cache, the business write request processing result is persisted to the corresponding business table in the preset database.

[0057] In some embodiments, the execution subject may persist the business write request processing result to the corresponding business table in the preset database in response to determining that the data version number corresponding to the business write request processing result in the message middleware is consistent with the data version number corresponding to the business write request processing result in the cache. Here, the business write request processing result may be persisted to the business table in the preset database for storing the business write request processing result.

[0058] The above-mentioned various embodiments of the present disclosure have the following beneficial effects: through the business writing method of some embodiments of the present disclosure, the business data writing time is shortened and the business data writing success rate is improved. Specifically, the reason for the failure of business data writing is that the index update of the database sub-table is not timely. Based on this, the business writing method of some embodiments of the present disclosure, first, in response to receiving a business write processing request, inquire whether there is a business write request processing result corresponding to the above business write processing request in the current cache. Thus, it is convenient to write asynchronous business data when the business write request processing result corresponding to the above business write processing request is not included in the cache. Then, in response to not querying the business write request processing result corresponding to the above business write processing request, generate the business write request processing result corresponding to the above business write processing request, and synchronize the above business write request processing result to the corresponding message topic in the message middleware. Thus, when the business write request processing result corresponding to the above business write processing request is not included in the cache, asynchronous processing of business data is realized. Then, according to the business identifier corresponding to the above business write processing request, the above business write request processing result is written to the above cache. Finally, in response to determining that the data version number corresponding to the business write request processing result in the message middleware is consistent with the data version number corresponding to the business write request processing result in the cache, the business write request processing result is persisted to the corresponding business table in the preset database. In this way, business data can be written asynchronously and in real time without referencing the database sub-table. Thus, the business data writing time is shortened and the business data writing success rate is improved.

[0059] Continue to refer Figure 3 , Figure 3 The process 300 of some other embodiments of the service writing method according to the present disclosure is shown. The service writing method comprises the following steps:

[0060] Step 301: In response to receiving a service write processing request, query whether there is a service write request processing result corresponding to the service write processing request in the current cache.

[0061] Step 302, in response to not finding a business write request processing result corresponding to the business write processing request, generate a business write request processing result corresponding to the business write processing request, and synchronize the business write request processing result to the corresponding message topic in the message middleware.

[0062] Step 303: Write the processing result of the business write request into the cache according to the business identifier corresponding to the business write processing request.

[0063] Step 304, in response to determining that the data version number corresponding to the business write request processing result in the above message middleware is consistent with the data version number corresponding to the business write request processing result in the above cache, persist the above business write request processing result to the corresponding business table in the preset database.

[0064] In some embodiments, the contents of steps 301-304 are the same as the contents of steps 201-204, and are not repeated here.

[0065] Step 305: query the cache according to the service write request identifier to obtain a cache query result.

[0066] In some embodiments, the execution subject of the business writing method (for example, Figure 1 The terminal device shown in the figure can query the cache according to the business write request identifier to obtain the cache query result. The business write request carries the business write request identifier. Here, the business write request identifier can be the identifier of the business write request. That is, the business write request processing result corresponding to the business write request identifier can be queried in the cache.

[0067] Step 306: In response to determining that the cache query result is empty, query the preset database to obtain a data query result.

[0068] In some embodiments, the execution subject may query the preset database in response to determining that the cache query result is empty to obtain a data query result, that is, the preset database may be queried for the service write request processing result corresponding to the service write request identifier.

[0069] Step 307: in response to determining that the data query result is empty, re-execute the business write operation of the business write processing request.

[0070] In some embodiments, the execution subject may re-execute the service write operation of the service write processing request in response to determining that the data query result is empty. Here, the service write operation may refer to the description in steps 301-306.

[0071] from Figure 3 It can be seen that Figure 2 Compared with the description of some corresponding embodiments, Figure 3 In some corresponding embodiments, the process 300 of the service writing method can determine whether the service writing request processing result is written successfully through the data version number and the service writing request identifier, thereby ensuring the stable operation of the service system.

[0072] Further references Figure 4As an implementation of the methods shown in the above figures, the present disclosure provides some embodiments of a business writing device, and these business writing device embodiments are Figure 2 Corresponding to the method embodiments shown, the service writing device can be specifically applied to various electronic devices.

[0073] like Figure 4 As shown, the business writing device 400 of some embodiments includes: a query unit 401, a generation unit 402, a writing unit 403 and a persistence unit 404. Among them, the query unit 401 is configured to query whether there is a business write request processing result corresponding to the business write processing request in the current cache in response to receiving a business write processing request; the generation unit 402 is configured to generate a business write request processing result corresponding to the business write processing request in response to not finding a business write request processing result corresponding to the business write processing request, and synchronize the business write request processing result to the corresponding message topic in the message middleware; the writing unit 403 is configured to write the business write request processing result to the cache according to the business identifier corresponding to the business write processing request; the persistence unit 404 is configured to persist the business write request processing result to the corresponding business table in the preset database in response to determining that the data version number corresponding to the business write request processing result in the message middleware is consistent with the data version number corresponding to the business write request processing result in the cache.

[0074] Optionally, the write unit 403 is further configured to: add the business information corresponding to the above-mentioned business write processing request to the above-mentioned business write request processing result; map the above-mentioned business identifier and the above-mentioned business write request processing result to generate a mapped business write request processing result; write the above-mentioned mapped business write request processing result into the above-mentioned cache, and set the cache expiration time of the above-mentioned mapped business write request processing result.

[0075] Optionally, before the writing unit 403, the business writing device also includes: a determination unit, configured to: determine whether the data version number corresponding to the business write request processing result in the above-mentioned message middleware is consistent with the data version number corresponding to the above-mentioned business write request processing result in the above-mentioned cache based on the business write request identifier included in the above-mentioned business write request processing result.

[0076] Optionally, the above service write processing request carries a service write request identifier.

[0077] Optionally, the business writing device also includes: a first query unit, configured to query the above-mentioned cache according to the above-mentioned business write request identifier to obtain a cache query result; a second query unit, configured to query the above-mentioned preset database in response to determining that the above-mentioned cache query result is empty to obtain a data query result.

[0078] Optionally, the business writing device further includes: a re-writing unit configured to re-execute the business writing operation of the business writing processing request in response to determining that the data query result is empty.

[0079] It is understandable that the units recorded in the business writing device 400 are similar to the reference Figure 2 Therefore, the operations, features and beneficial effects described above for the method are also applicable to the service writing device 400 and the units included therein, and will not be described in detail here.

[0080] Reference below Figure 5 , which shows an electronic device suitable for implementing some embodiments of the present disclosure (e.g., Figure 1 The electronic devices in some embodiments of the present disclosure may include but are not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0081] like Figure 5 As shown, the electronic device 500 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic device 500 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0082] Typically, the following devices may be connected to the I / O interface 505: an input device 506 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 508 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 509. The communication device 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 5The electronic device 500 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead. Figure 5 Each block shown in the figure may represent one device, or may represent multiple devices as required.

[0083] In particular, according to some embodiments of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, some embodiments of the present disclosure include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In some such embodiments, the computer program can be downloaded and installed from the network through the communication device 509, or installed from the storage device 508, or installed from the ROM 502. When the computer program is executed by the processing device 501, the above-mentioned functions defined in the method of some embodiments of the present disclosure are executed.

[0084] It should be noted that the computer-readable medium recorded in some embodiments of the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In some embodiments of the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In some embodiments of the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0085] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0086] The computer-readable medium may be included in the electronic device; or it may exist independently without being assembled into the electronic device. The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: in response to receiving a business write processing request, inquire whether there is a business write request processing result corresponding to the business write processing request in the current cache; in response to not finding a business write request processing result corresponding to the business write processing request, generate a business write request processing result corresponding to the business write processing request, and synchronize the business write request processing result to the corresponding message topic in the message middleware; according to the business identifier corresponding to the business write processing request, write the business write request processing result to the cache; in response to determining that the data version number corresponding to the business write request processing result in the message middleware is consistent with the data version number corresponding to the business write request processing result in the cache, persist the business write request processing result to the corresponding business table in the preset database.

[0087] Computer program code for performing the operations of some embodiments of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0088] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0089] The units described in some embodiments of the present disclosure may be implemented by software or by hardware. The described units may also be provided in a processor, for example, may be described as: a processor comprising: a query unit, a generation unit, a write unit and a persistence unit. Among them, the names of these units do not constitute a limitation on the unit itself in certain circumstances, for example, the write unit may also be described as "a unit that writes the above-mentioned business write request processing result to the above-mentioned cache according to the business identifier corresponding to the above-mentioned business write processing request".

[0090] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0091] Some embodiments of the present disclosure further provide a computer program product, including a computer program, which implements any of the above-mentioned business writing methods when executed by a processor.

[0092] The above descriptions are only some preferred embodiments of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above invention concept. For example, the above features are replaced with (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure.

Claims

1. A business writing method, comprising: In response to receiving the service write processing request, querying whether there is a service write request processing result corresponding to the service write processing request in the current cache; In response to not finding a business write request processing result corresponding to the business write processing request, generating a business write request processing result corresponding to the business write processing request, and synchronizing the business write request processing result to a corresponding message topic in the message middleware; Writing the service write request processing result into the cache according to the service identifier corresponding to the service write processing request; In response to determining that the data version number corresponding to the business write request processing result in the message middleware is consistent with the data version number corresponding to the business write request processing result in the cache, the business write request processing result is persisted to the corresponding business table in the preset database.

2. The method according to claim 1, wherein: Writing the service write request processing result into the cache includes: Adding the business information corresponding to the business write processing request to the business write request processing result; Mapping the service identifier and the service write request processing result to generate a mapped service write request processing result; The mapping service write request processing result is written into the cache, and a cache expiration time of the mapping service write request processing result is set.

3. The method according to claim 1, wherein: In response to determining that the data version number corresponding to the business write request processing result in the message middleware is consistent with the data version number corresponding to the business write request processing result in the cache, before persisting the business write request processing result to the corresponding business table in the preset database, the method also includes: According to the business write request identifier included in the business write request processing result, it is determined whether the data version number corresponding to the business write request processing result in the message middleware is consistent with the data version number corresponding to the business write request processing result in the cache.

4. The method according to claim 3, wherein: The business write processing request carries a business write request identifier; as well as The method further comprises: According to the business write request identifier, query the cache to obtain a cache query result; In response to determining that the cache query result is empty, a query is performed in the preset database to obtain a data query result.

5. The method according to claim 4, wherein: The method further comprises: In response to determining that the data query result is empty, re-executing the service write operation of the service write processing request.

6. A service writing device, comprising: A query unit, configured to query whether there is a service write request processing result corresponding to the service write processing request in the current cache in response to receiving the service write processing request; A generating unit, configured to generate a business write request processing result corresponding to the business write processing request in response to not finding a business write request processing result corresponding to the business write processing request, and synchronize the business write request processing result to a corresponding message topic in the message middleware; A writing unit, configured to write the service write request processing result into the cache according to the service identifier corresponding to the service write processing request; The persistence unit is configured to persist the business write request processing result to the corresponding business table in the preset database in response to determining that the data version number corresponding to the business write request processing result in the message middleware is consistent with the data version number corresponding to the business write request processing result in the cache.

7. The device according to claim 6, wherein: The writing unit is further configured to: Adding the business information corresponding to the business write processing request to the business write request processing result; Mapping the service identifier and the service write request processing result to generate a mapped service write request processing result; The mapping service write request processing result is written into the cache, and a cache expiration time of the mapping service write request processing result is set.

8. An electronic device comprising: one or more processors; a storage device having one or more programs stored thereon; When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 5.

9. A computer readable medium having a computer program stored thereon, wherein: When the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.

10. A computer program product, comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 5.