CN109582685B - Method and device for recording context request execution process - Google Patents
Method and device for recording context request execution process Download PDFInfo
- Publication number
- CN109582685B CN109582685B CN201811463477.8A CN201811463477A CN109582685B CN 109582685 B CN109582685 B CN 109582685B CN 201811463477 A CN201811463477 A CN 201811463477A CN 109582685 B CN109582685 B CN 109582685B
- Authority
- CN
- China
- Prior art keywords
- request
- context
- service
- record text
- information
- 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
Links
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The embodiment of the invention provides a method and a device for recording a context request execution process, wherein the method comprises the following steps: acquiring a context request of the service case, and acquiring version information of each off-line context record text of the service case cached in a preset memory address; judging whether the version number of the request in the context request of the service use case is higher than the version number in the version information of any offline context recording text of the service use case; if yes, recording the execution process of the context request; after the context request is successfully executed, generating a first context record text aiming at the service use case by the execution process of the context request according to the data format of the key value pair; and updating the version number of the request in the context request of the service use case to a preset memory address. By the method and the device, the accurate and efficient change of the service can be realized through the text generated by the context without depending on manual maintenance of manpower.
Description
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for recording a context request execution process.
Background
With the development of internet technology, currently, a website architecture mainly adopts a mode of front-end rendering and front-end and back-end separation, and data transmission between the front-end and the back-end is mainly realized through an Application Programming Interface (API), so that an API Interface tool is used for managing a call flow of a service request context, so that important references can be provided for the work of personnel for front-end and back-end development, testing and the like, and great convenience is provided for the work of newly-entered or business-unfamiliar personnel, but the existing API Interface tool has certain disadvantages, for example, the disadvantages of the API context tool based on a current service module include: the method can only realize the recording of the request context mode of a single service API, and cannot record the request context mode of a complex service module; for a scene with frequently changed service, the scene cannot be updated in time; the API interfaces of the service modules need to be maintained additionally, and the labor maintenance cost is too high, for example, when a developer adds a new API interface or modifies request parameters of an existing API interface, the additional developer needs to update the partially changed API in time, and if the updated API interfaces are not updated in time, the functions depending on the partially changed API may be called abnormally, and the accuracy of the interdependent relationship between the service modules and the execution sequence cannot be ensured.
Disclosure of Invention
The embodiment of the invention provides a method and a device for recording a context request execution process, which can realize accurate and efficient service change through a text generated by context without depending on manual maintenance of manpower.
In one aspect, an embodiment of the present invention provides a method for recording a context request execution process, including:
executing each service case according to a preset execution rule;
when the execution of any service case is monitored, acquiring a context request of the service case, and acquiring version information of each offline context recording text of the service case cached in a preset memory address, wherein the version information comprises a version number, the context request of the service case comprises a requested version number, and the version information of each offline context recording text of the service case is cached in the preset memory address in a sequence table mode;
judging whether the version number of a request in the context request of the business case is higher than the version number in the version information of any offline context record text of the business case;
if yes, recording the execution process of the context request;
judging whether the execution of the context request is successful or not according to the execution result information of the context request;
after the context request is successfully executed, generating a first context record text aiming at the service use case according to the data format of a key value pair in the execution process of the context request, and storing the first context record text into a database for storing each context record text;
and updating the version number of the request in the context request of the service use case to a preset memory address.
In another aspect, an embodiment of the present invention provides an apparatus for recording a context request execution process, where the apparatus includes:
the execution module is used for executing each service case according to a preset execution rule;
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a context request of a service case and acquiring version information of each offline context recording text of the service case which is cached in a preset memory address when the execution of any service case is monitored, the version information comprises a version number, the context request of the service case comprises a requested version number, and the version information of each offline context recording text of the service case is cached in the preset memory address in a sequence table mode;
the first judgment module is used for judging whether the version number of the request in the context request of the service case is higher than the version number in the version information of any offline context recording text of the service case;
the recording module is used for recording the execution process of the context request if the context request is higher than the preset context request;
a second judging module, configured to judge whether the context request is successfully executed according to the context request execution result information;
the generating module is used for generating a first context record text aiming at the service case according to the data format of a key value pair in the execution process of the context request after the context request is executed successfully, and storing the first context record text into a database for storing each context record text;
and the updating module is used for updating the version number of the request in the context request of the service use case to a preset memory address.
The technical scheme has the following beneficial effects: by the method, the device and the system, the business context can be recorded according to the personalized requirements of the user, the version information of each offline context recording text of the business case is cached in the preset memory address in a sequence table mode, and whether the execution process of the context request is recorded or not is judged through the version information, so that the business context can be quickly, efficiently and accurately recorded, the accuracy and consistency of the generation of the business context are ensured, the real-time performance of the context recording is ensured, and the condition that the business context is replaced by the old version to cause errors in the business execution process is also avoided; the method and the device realize accurate and efficient change of the service through the text generated by the context without depending on manual maintenance of manpower, thereby reducing maintenance cost greatly and improving the efficiency of service operation; furthermore, the original context calling record can be guaranteed not to be influenced under the condition of abnormal system calling, so that the normal operation of the service is guaranteed.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flowchart of a method for recording a context request execution process according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of an apparatus for recording a context request execution process according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, belong to the protection scope of the present invention.
As shown in fig. 1, a flowchart of a method for recording a context request execution process in an embodiment of the present invention is shown, where the method includes:
101. executing each service case according to a preset execution rule;
102. when the execution of any service case is monitored, acquiring a context request of the service case, and acquiring version information of each offline context recording text of the service case cached in a preset memory address, wherein the version information comprises a version number, the context request of the service case comprises a requested version number, and the version information of each offline context recording text of the service case is cached in the preset memory address in a sequence table mode;
103. judging whether the version number of the request in the context request of the service use case is higher than the version number in the version information of any offline context recording text of the service use case;
104. if yes, recording the execution process of the context request;
105. judging whether the execution of the context request is successful or not according to the execution result information of the context request;
106. after the context request is successfully executed, generating a first context record text aiming at the service use case by the execution process of the context request according to the data format of the key value pair, and storing the first context record text into a database for storing each context record text;
107. and updating the version number of the request in the context request of the service use case to a preset memory address.
Further, the predetermined execution rule includes any one of:
a predetermined execution frequency;
a predetermined execution period;
according to the classification identification information of different service cases, presetting different execution frequencies or execution periods;
when different execution frequencies or execution cycles are predetermined according to the classification identification information of different service use cases, the method further comprises the following steps:
and classifying different service cases, and setting classification identification information corresponding to the service cases.
Optionally, the method further comprises:
pre-creating a sequence table for storing each off-line context record text version information of each service case in a predetermined memory;
before the step of obtaining the version information of each offline context record text of the service use case cached in a predetermined memory address, the method includes:
judging whether version information of each offline context record text of the business case is cached in the sequence table in a preset memory address;
if it is determined that the version information of each offline context record text of the business case is not cached in the sequence table in the predetermined memory address, the method includes:
and caching the preset initialization version information of the service use case in the sequence list.
Optionally, the method further comprises:
storing the sequence table in a preset array or a preset linked list in the preset memory address;
wherein, the method also comprises:
a predetermined array or a predetermined linked list is pre-created in a predetermined memory address.
Further, a key in the data format of the key-value pair is used to store service identification information, and a value in the data format of the key-value pair is used to store execution process information of a service use case corresponding to the service identification information.
Further, the step of storing the first context record text in a database for storing each context record text specifically includes:
according to the service identification information of the service case, whether a second context record text matched with the service identification information exists or not is inquired in a database, and the second context record text is used for recording the execution process of the service case;
and if the context record text exists, replacing the execution process information of the service corresponding to the service use case recorded in the second context record text stored in the database with the execution process information recorded in the first context record text.
Optionally, the method further comprises:
when a request for a context record text of any service is received, determining the request type of the request;
according to the determined request type, acquiring request data matched with the request from the database, and sending the request data to the front end so that the front end can display the information in the context record text in a human-computer interaction interface;
wherein the request type comprises any one of a query request, a creation request and an update request;
if the request type of the request is determined to be a query request or an update request, the request data matched with the request is acquired from the database according to the determined request type and is sent to the front end, so that the front end displays the information in the context record text in a human-computer interaction interface, and the method specifically comprises the following steps: determining service identification information in the query request; based on the service identification information, inquiring data in a key-value pair data format matched with the service identification information in the database; determining a context recording text for recording the execution process of the service use case in the data in the key value pair data format according to the inquired data in the key value pair data format; sending the determined context record text to a front end, so that the front end can display information in the context record text in a human-computer interaction interface;
if the request type of the request is determined to be a creation request, the request data matched with the request is obtained from the database according to the determined request type and is sent to the front end, so that the front end can display the information in the context record text in a human-computer interaction interface, and the method specifically comprises the following steps: creating service identification information in the creation request; and based on the service identification information, creating a context record text matched with the service identification information in the database, and sending the created context record text to the front end so that the front end can display the information in the created context record text in a human-computer interaction interface.
As shown in fig. 2, a schematic structural diagram of an apparatus for recording a context request execution process in an embodiment of the present invention includes:
the execution module 21 is configured to execute each service case according to a predetermined execution rule;
an obtaining module 22, configured to obtain a context request of a service case when it is monitored that any service case is executed, and obtain version information of each offline context recording text of the service case, which is cached in a predetermined memory address, where the version information includes a version number, and the context request of the service case includes a requested version number, where the version information of each offline context recording text of the service case is cached in the predetermined memory address in a sequential table manner;
a first determining module 23, configured to determine whether a version number of a request in the context request of the service case is higher than a version number in version information of any offline context record text of the service case;
a recording module 24, configured to record an execution process of the context request if the context is higher than the threshold;
a second judging module 25, configured to judge whether the execution of the context request is successful according to the context request execution result information;
a generating module 26, configured to, after the context request is successfully executed, generate a first context record text for the service use case according to a data format of a key-value pair in an execution process of the context request, and store the first context record text in a database for storing each context record text;
an updating module 27, configured to update a version number of a request in the context request of the service use case to a predetermined memory address.
Further, the predetermined execution rule includes any one of:
a predetermined execution frequency;
a predetermined execution period;
according to the classification identification information of different service cases, presetting different execution frequencies or execution periods;
wherein, the predetermined execution rule is according to the classification identification information of different service use cases, when different execution frequencies or execution cycles are predetermined, the device further comprises:
and the setting module is used for classifying different service cases and setting classification identification information corresponding to the service cases.
Optionally, the method further comprises:
the first pre-creation module is used for pre-creating a sequence table for storing each offline context record text version information of each service case in a preset memory;
the obtaining module is specifically configured to determine whether version information of each offline context record text of the service case is cached in the sequence table in a predetermined memory address;
if it is determined that the version information of each offline context record text of the business case is not cached in the sequence table in the predetermined memory address, the obtaining module includes:
the buffer unit is used for buffering the preset initialization version information of the service use case in the sequence list;
optionally, the method further comprises:
the storage module is used for storing the sequence table in a preset array or a preset linked list in the preset memory address;
the second pre-creation module is used for pre-creating a predetermined array or a predetermined linked list in a predetermined memory address;
further, a key in the data format of the key-value pair is used for storing service identification information, and a value in the data format of the key-value pair is used for storing execution process information of a service use case corresponding to the service identification information;
further, the generating module is specifically configured to
According to the service identification information of the service case, whether a second context record text matched with the service identification information exists or not is inquired in a database, and the second context record text is used for recording the execution process of the service case;
if the context record text exists, replacing the execution process information of the service corresponding to the service use case recorded in the second context record text stored in the database with the execution process information recorded in the first context record text;
optionally, the method further comprises:
the system comprises a determining module, a judging module and a sending module, wherein the determining module is used for determining the request type of a request when the request of a context record text aiming at any service is received;
the sending module is used for acquiring request data matched with the request from the database according to the determined request type and sending the request data to the front end so that the front end can display the information in the context record text in a human-computer interaction interface;
wherein the request type comprises any one of a query request, a creation request and an update request;
if the request type of the request is determined to be a query request or an update request in the determining module, the sending module is specifically configured to determine service identification information in the query request; based on the service identification information, inquiring data in a key-value pair data format matched with the service identification information in the database; determining a context recording text for recording the execution process of the service use case in the data in the key value pair data format according to the inquired data in the key value pair data format; sending the determined context record text to a front end, so that the front end can display information in the context record text in a human-computer interaction interface;
if the request type of the request is determined to be a creation request in the determining module, the sending module is specifically configured to create service identifier information in the creation request; and based on the service identification information, creating a context record text matched with the service identification information in the database, and sending the created context record text to the front end, so that the front end can display the information in the created context record text in a human-computer interaction interface.
The technical scheme of the embodiment of the invention has the following beneficial effects: by the method and the device, the business context can be recorded according to the personalized requirements of the user, the version information of each offline context recording text of the business case is cached in the preset memory address in a sequence table mode, and whether the execution process of the context request is recorded or not is judged according to the version information, so that the business context can be recorded quickly, efficiently and accurately, the accuracy and consistency of the generation of the business context are ensured, the real-time performance of the context recording is ensured, and the condition that the business context is replaced by the old version to cause errors in the business execution process is avoided; the method and the device realize accurate and efficient change of the service through the text generated by the context without depending on manual maintenance of manpower, thereby reducing maintenance cost greatly and improving the efficiency of service operation; furthermore, the original context calling record can be guaranteed not to be influenced under the condition of abnormal system calling, so that the normal operation of the service is guaranteed.
The above technical solution of the embodiment of the present invention is described in detail below with reference to the application examples:
the application example of the invention aims to realize the quick, accurate and efficient change of the service through the text generated by the context without depending on manual maintenance of manpower.
As shown in fig. 1, for example, in the netpage system a, each service case is executed according to a predetermined execution rule, for example, at a predetermined frequency, for example, once every 10 seconds; when a service case, such as the service case M1, is monitored, a context request of the service case M1 is acquired in a reflection manner when the service case is executed, and version information of each offline context recording text of the service case M1 cached in a predetermined memory address is acquired, wherein the version information includes a version number, the context request of the service case M1 includes a requested version number, for example, the requested version number is "2.0", and the version information of each offline context recording text of the service case M1 is cached in the predetermined memory address in a sequence table manner; judging whether the version number '2.0' of the request in the context request of the service case M1 is higher than the version number in the version information of any offline context recording text of the service case M1; if yes, recording the execution process of the context request; then, according to the context request execution result information, if the execution result information contains the identification information of whether the execution is successful, judging whether the execution of the context request is successful according to the identification information of whether the execution is successful; after the context request is successfully executed, generating a first context record text for the service case M1 according to a data format of a key-value pair, such as a data format of a key-value pair, in an execution process of the context request, and storing the first context record text into a database for storing each context record text; and updating the version number of the request in the context request of the service case M1 to a preset memory address.
And the value in the data format of the key value pair is used for storing the execution process information of the service use case corresponding to the service identification information. It will be appreciated by those skilled in the art that there are many data formats for key-value pairs, and the present invention is illustrated by way of example and not by way of limitation.
In one possible implementation, the predetermined execution rule includes any one of the following: a predetermined execution frequency; a predetermined execution period; and reserving different execution frequencies or execution periods according to the classification identification information of different service use cases.
When different execution frequencies or execution periods are preset according to the classification identification information of different service use cases, the method further comprises the following steps: and classifying different service cases, and setting classification identification information corresponding to the service cases.
For example, the service cases 1, 2, 3, and 4 are classified, the service cases 1 are classified into one class, the service cases 2 are classified into one class, and the service cases 3 and 4 are classified into one class, and the classification identification information of the service case 1 is set to be a, the classification identification information of the service case 2 is set to be B, and the classification identification information of the service cases 3 and 4 is set to be C.
According to the embodiment, the method and the device can accurately and efficiently provide important precondition guarantee for executing the service case to be operated and generating the corresponding context record text in time.
In one possible implementation, the method further includes: and pre-creating a sequence table for storing each off-line context record text version information of each service use case in a predetermined memory.
Before the step of obtaining the version information of each offline context record text of the service use case cached in a predetermined memory address, the method includes: and judging whether the version information of each offline context record text of the service case is cached in the sequence table in a preset memory address.
If it is determined that the version information of each offline context record text of the business case is not cached in the sequence table in the predetermined memory address, the method further includes: and caching the preset initialization version information of the service use case in the sequence table.
For example, in the web page system a, a sequence table L for storing each offline context record text version information of each service use case is pre-created in a predetermined memory; executing each service case according to a predetermined execution rule, for example, at a predetermined frequency, for example, once every 10 seconds; when a service case, such as the service case M1, is monitored, a context request of the service case M1 is acquired in a reflection mode when the service case is executed, and then whether version information of each offline context record text of the service case M1 is cached in a sequence table L in a preset memory address is judged; if the version information of each offline context recording text of the business case M1 is not cached in the sequence table L in the preset memory address, caching the preset initialization version information of the business case M1 in the sequence table L; if the version information of each offline context record text of the service case M1 cached in the sequence table L in the predetermined memory address is judged, the version information of each offline context record text of the service case M1 cached in the predetermined memory address is obtained.
By the embodiment, the business cases are executed according to the user-defined rule, waste of system resources is avoided, and meanwhile, efficient access to each offline context record text version information of each business case can be realized by storing each offline context record text version information of each business case in the sequence table, so that the access speed of each offline context record text version information of each business case is greatly improved.
In one possible implementation, the method further includes: and storing the sequence table in a preset array or a preset linked list in the preset memory address.
Wherein, the method also comprises: a predetermined array or a predetermined linked list is pre-created in a predetermined memory address.
For example, in the webpage system a, a predetermined array or a predetermined linked list is pre-created in a predetermined memory address; pre-creating a sequence table L for storing each off-line context record text version information of each service case in a predetermined memory; the sequence table L is stored in a predetermined array or a predetermined linked list in a predetermined memory address.
By the embodiment, the speed of inserting and deleting the text version information of each offline context record of each business case can be realized on the basis of efficiently accessing the text version information of each offline context record of each business case, and the efficiency of recording the context record text is further improved.
In a possible implementation manner, the step of storing the first context record text in a database for storing each context record text specifically includes: according to the service identification information of the service case, whether a second context record text matched with the service identification information exists or not is inquired in a database, and the second context record text is used for recording the execution process of the service case; and if the context record text exists, replacing the execution process information of the service corresponding to the service case recorded in the second context record text stored in the database with the execution process information recorded in the first context record text.
For example, in the netpage system a, each service case is executed according to a predetermined execution rule, for example, at a predetermined frequency, for example, once every 10 seconds; when a service case, such as the service case M1, is monitored, a context request of the service case M1 is acquired in a reflection manner when the service case is executed, and version information of each offline context recording text of the service case M1 cached in a predetermined memory address is acquired, wherein the version information includes a version number, the context request of the service case M1 includes a requested version number, and if the version number of the request in the context request of the service case M1 is judged to be higher than the version number in the version information of any offline context recording text of the service case M1, an execution process of the context request is recorded; then, according to the context request execution result information, if the execution result information contains the identification information of whether the execution is successful, judging whether the execution of the context request is successful according to the identification information of whether the execution is successful; after the context request is successfully executed, generating a first context record text F1 for the service case M1 according to a data format of a key-value pair, such as the data format of the key-value pair, in the execution process of the context request, querying whether a second context record text F2 matched with the service identification information M1 exists in a database, such as a DB, according to the service identification information, such as the key-value pair, of the service case M1, wherein the second context record text F2 is used for recording the execution process of the service case M1; if the context record text F1 exists, replacing the execution process information of the service corresponding to the service case M1 recorded in the second context record text F2 stored in the database DB with the execution process information recorded in the first context record text F1; and updating the version number of the request in the context request of the service case M1 to a preset memory address.
In one possible implementation, the method further includes: when a request for context record text of any service is received, determining the request type of the request; and according to the determined request type, acquiring request data matched with the request from the database, and sending the request data to the front end so that the front end can display the information in the context record text in a human-computer interaction interface.
Wherein the request type includes any one of a query request, a create request, and an update request.
If the request type of the request is determined to be a query request or an update request, the request data matched with the request is acquired from the database according to the determined request type and is sent to the front end, so that the front end displays the information in the context record text in a human-computer interaction interface, and the method specifically comprises the following steps: determining service identification information in the query request; based on the service identification information, inquiring data in a key-value pair data format matched with the service identification information in the database; determining a context recording text for recording the execution process of the service use case in the data in the key value pair data format according to the inquired data in the key value pair data format; and sending the determined context record text to the front end so that the front end can display the information in the context record text in a human-computer interaction interface.
If the request type of the request is determined to be a creation request, the request data matched with the request is obtained from the database according to the determined request type and is sent to the front end, so that the front end can display the information in the context record text in a human-computer interaction interface, and the method specifically comprises the following steps: creating service identification information in the creation request; and based on the service identification information, creating a context record text matched with the service identification information in the database, and sending the created context record text to the front end, so that the front end can display the information in the created context record text in a human-computer interaction interface.
For example, in the netpage system a, when a request for context record text of any service is received, the request type of the request is determined; if the request type of the request is determined to be a query request or an update request, determining service identification information in the query request, such as M1; based on the service identification information M1, inquiring data in a key value pair data format matched with the service identification information M1 in a database DB; determining a context recording text, such as F1, in the data in the key-value-pair data format, for recording the execution process of the service case M1 according to the queried data in the key-value-pair data format; sending the determined context record text F1 to the front end, so that the front end can display the information in the context record text F1 in a human-computer interaction interface; if the request type of the request is determined to be a creation request, creating service identification information in the creation request, such as M5; based on the service identification information M5, a context record text, such as F5, matching the service identification information M5 is created in the database DB, and the F5 is sent to the front end, so that the front end displays information in the created context record text F5 in the human-computer interaction interface.
Through the embodiment, the user can manage the execution process of the context request record greatly, the user can manage the execution process of the context request record more efficiently, and the use experience of the user is further improved.
The embodiment of the present invention provides a device for recording a context request execution process, which can implement the method embodiment provided above, and for specific function implementation, reference is made to the description in the method embodiment, which is not described herein again.
It should be understood that the specific order or hierarchy of steps in the processes disclosed is an example of exemplary approaches. Based upon design preferences, it is understood that the specific order or hierarchy of steps in the processes may be rearranged without departing from the scope of the present disclosure. The accompanying method claims present elements of the various steps in a sample order, and are not meant to be limited to the specific order or hierarchy presented.
In the foregoing detailed description, various features are grouped together in a single embodiment for the purpose of streamlining the disclosure. This method of disclosure is not to be interpreted as reflecting an intention that the claimed embodiments of the subject matter require more features than are expressly recited in each claim. Rather, as the following claims reflect, invention lies in less than all features of a single disclosed embodiment. Thus, the following claims are hereby expressly incorporated into the detailed description, with each claim standing on its own as a separate preferred embodiment of the invention.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. To those skilled in the art; various modifications to these embodiments will be readily apparent, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the disclosure. Thus, the present disclosure is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
What has been described above includes examples of one or more embodiments. It is, of course, not possible to describe every conceivable combination of components or methodologies for purposes of describing the aforementioned embodiments, but one of ordinary skill in the art may recognize that many further combinations and permutations of various embodiments are possible. Accordingly, the embodiments described herein are intended to embrace all such alterations, modifications and variations that fall within the scope of the appended claims. Furthermore, to the extent that the term "includes" is used in either the detailed description or the claims, such term is intended to be inclusive in a manner similar to the term "comprising" as "comprising" is interpreted when employed as a transitional word in a claim. Furthermore, any use of the term "or" in the specification of the claims is intended to mean a "non-exclusive or".
Those of skill in the art will further appreciate that the various illustrative logical blocks, units, and steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate the interchangeability of hardware and software, various illustrative components, elements, and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as hardware or software depends upon the particular application and design requirements of the overall system. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present embodiments.
The various illustrative logical blocks, or elements, described in connection with the embodiments disclosed herein may be implemented or performed with a general purpose processor, a digital signal processor, an Application Specific Integrated Circuit (ASIC), a field programmable gate array or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination thereof designed to perform the functions described herein. A general-purpose processor may be a microprocessor, but in the alternative, the processor may be any conventional processor, controller, microcontroller, or state machine. A processor may also be implemented as a combination of computing devices, e.g., a digital signal processor and a microprocessor, a plurality of microprocessors, one or more microprocessors in conjunction with a digital signal processor core, or any other similar configuration.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may be stored in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art. For example, a storage medium may be coupled to the processor such that the processor can read information from, and write information to, the storage medium. In the alternative, the storage medium may be integral to the processor. The processor and the storage medium may reside in an ASIC, which may be located in a user terminal. In the alternative, the processor and the storage medium may reside as discrete components in a user terminal.
In one or more exemplary designs, the functions described above in connection with the embodiments of the invention may be implemented in hardware, software, firmware, or any combination of the three. If implemented in software, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media includes both computer storage media and communication media that facilitate transfer of a computer program from one place to another. Storage media may be any available media that can be accessed by a general purpose or special purpose computer. For example, such computer-readable media can include, but is not limited to, RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to carry or store program code in the form of instructions or data structures and which can be read by a general-purpose or special-purpose computer, or a general-purpose or special-purpose processor. In addition, any connection is properly termed a computer-readable medium, and thus is included if the software is transmitted from a website, server, or other remote source via a coaxial cable, fiber optic cable, twisted pair, digital Subscriber Line (DSL), or wirelessly, e.g., infrared, radio, and microwave. Such discs (disk) and disks (disc) include compact disks, laser disks, optical disks, DVDs, floppy disks and blu-ray disks where disks usually reproduce data magnetically, while disks usually reproduce data optically with lasers. Combinations of the above may also be included in the computer-readable medium.
The above-mentioned embodiments are intended to illustrate the objects, technical solutions and advantages of the present invention in further detail, and it should be understood that the above-mentioned embodiments are merely exemplary embodiments of the present invention, and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.
Claims (10)
1. A method for logging context request execution, comprising:
executing each service case according to a preset execution rule;
when monitoring that any service case is executed, acquiring a context request of the service case, and acquiring version information of each offline context record text of the service case which is cached in a preset memory address, wherein the version information comprises a version number, the context request of the service case comprises the requested version number, and the version information of each offline context record text of the service case is cached in the preset memory address in a sequence table mode;
judging whether the version number of the request in the context request of the service use case is higher than the version number in the version information of any offline context recording text of the service use case;
if yes, recording the execution process of the context request;
judging whether the execution of the context request is successful or not according to the execution result information of the context request;
after the context request is successfully executed, generating a first context record text aiming at the service use case by the execution process of the context request according to the data format of the key value pair, and storing the first context record text into a database for storing each context record text; wherein the data format of the key-value pair is a key-value format;
and updating the version number of the request in the context request of the service use case to a preset memory address.
2. The method of claim 1, wherein the predetermined execution rule comprises any of:
a predetermined execution frequency;
a predetermined execution period;
according to the classification identification information of different service cases, presetting different execution frequencies or execution periods;
when different execution frequencies or execution cycles are predetermined according to the classification identification information of different service use cases, the method further comprises the following steps:
and classifying different service cases, and setting classification identification information corresponding to the service cases.
3. The method of claim 1 or 2, further comprising:
pre-creating a sequence table for storing each off-line context record text version information of each service case in a predetermined memory;
before the step of obtaining the version information of each offline context record text of the service use case cached in a predetermined memory address, the method includes:
judging whether version information of each offline context record text of the business case is cached in the sequence table in a preset memory address;
if it is determined that the version information of each offline context record text of the business case is not cached in the sequence table in the predetermined memory address, the method includes:
and caching the preset initialization version information of the service use case in the sequence table.
4. The method of claim 3, further comprising:
storing the sequence table in a predetermined array or a predetermined linked list in the predetermined memory address;
wherein, the method also comprises:
a predetermined array or a predetermined linked list is pre-created in a predetermined memory address.
5. The method according to claim 1, wherein a key in the data format of the key-value pair is used to store service identification information, and a value in the data format of the key-value pair is used to store execution procedure information of a service use case corresponding to the service identification information.
6. The method according to claim 5, wherein the step of storing the first context record text in a database for storing each context record text specifically comprises:
according to the service identification information of the service use case, whether a second context record text matched with the service identification information exists or not is inquired in a database, and the second context record text is used for recording the execution process of the service use case;
and if the context record text exists, replacing the execution process information of the service corresponding to the service use case recorded in the second context record text stored in the database with the execution process information recorded in the first context record text.
7. The method of claim 5, further comprising:
when a request for context record text of any service is received, determining the request type of the request;
according to the determined request type, acquiring request data matched with the request from the database, and sending the request data to the front end so that the front end can display the information in the context record text in a human-computer interaction interface;
wherein the request type comprises any one of a query request, a creation request and an update request;
if the request type of the request is determined to be a query request or an update request, the request data matched with the request is acquired from the database according to the determined request type and is sent to the front end, so that the front end displays the information in the context record text in a human-computer interaction interface, and the method specifically comprises the following steps: determining service identification information in the query request; based on the service identification information, inquiring data in a key-value pair data format matched with the service identification information in the database; determining a context recording text for recording the execution process of the service use case in the data in the key value pair data format according to the inquired data in the key value pair data format; sending the determined context record text to a front end, so that the front end can display information in the context record text in a human-computer interaction interface;
if the request type of the request is determined to be a creation request, the request data matched with the request is obtained from the database according to the determined request type and is sent to the front end, so that the front end can display the information in the context record text in a human-computer interaction interface, and the method specifically comprises the following steps: creating service identification information in the creation request; and based on the service identification information, creating a context record text matched with the service identification information in the database, and sending the created context record text to the front end, so that the front end can display the information in the created context record text in a human-computer interaction interface.
8. An apparatus for recording context request execution procedures, comprising:
the execution module is used for executing each service case according to a preset execution rule;
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a context request of a service case and acquiring version information of each offline context recording text of the service case which is cached in a preset memory address when the execution of any service case is monitored, the version information comprises a version number, the context request of the service case comprises a requested version number, and the version information of each offline context recording text of the service case is cached in the preset memory address in a sequence table mode;
the first judging module is used for judging whether the version number of a request in the context request of the business case is higher than the version number in the version information of any offline context record text of the business case;
the recording module is used for recording the execution process of the context request if the context request is higher than the preset context request;
the second judgment module is used for judging whether the execution of the context request is successful according to the execution result information of the context request;
the generating module is used for generating a first context record text aiming at the service case according to the data format of a key value pair in the execution process of the context request after the context request is executed successfully, and storing the first context record text into a database for storing each context record text; the data format of the key value pair is in a key-value format;
and the updating module is used for updating the version number of the request in the context request of the service use case to a preset memory address.
9. The apparatus of claim 8, wherein the predetermined execution rule comprises any one of:
a predetermined execution frequency;
a predetermined execution period;
according to the classification identification information of different service cases, presetting different execution frequencies or execution periods;
wherein, the predetermined execution rule is according to the classification identification information of different service use cases, when different execution frequencies or execution cycles are predetermined, the device further comprises:
and the setting module is used for classifying different service cases and setting classification identification information corresponding to the service cases.
10. The apparatus of claim 8 or 9, further comprising:
the first pre-creation module is used for pre-creating a sequence table for storing each offline context record text version information of each service case in a preset memory;
the obtaining module is specifically configured to determine whether version information of each offline context record text of the service case is cached in the sequence table in a predetermined memory address;
if it is determined that the version information of each offline context record text of the service case is not cached in the sequence table in the predetermined memory address, the obtaining module includes:
the buffer unit is used for buffering the preset initialization version information of the service use case in the sequence list;
wherein, still include:
the storage module is used for storing the sequence table in a preset array or a preset linked list in the preset memory address;
the second pre-creation module is used for pre-creating a preset array or a preset linked list in a preset memory address;
the key in the data format of the key value pair is used for storing service identification information, and the value in the data format of the key value pair is used for storing the execution process information of the service use case corresponding to the service identification information;
wherein the generating module is specifically used for
According to the service identification information of the service use case, whether a second context record text matched with the service identification information exists or not is inquired in a database, and the second context record text is used for recording the execution process of the service use case;
if the context record text exists, replacing the execution process information of the service corresponding to the service case recorded in the second context record text stored in the database with the execution process information recorded in the first context record text;
wherein, still include:
the system comprises a determining module, a judging module and a sending module, wherein the determining module is used for determining the request type of a request when the request of a context record text aiming at any service is received;
the sending module is used for acquiring request data matched with the request from the database according to the determined request type and sending the request data to the front end so that the front end can display the information in the context record text in a human-computer interaction interface;
wherein the request type comprises any one of a query request, a creation request and an update request;
if the request type of the request is determined to be a query request or an update request in the determining module, the sending module is specifically configured to determine service identification information in the query request; based on the service identification information, inquiring data in a key-value pair data format matched with the service identification information in the database; determining a context recording text for recording the execution process of the service use case in the data in the key value pair data format according to the inquired data in the key value pair data format; sending the determined context record text to a front end, so that the front end can display information in the context record text in a human-computer interaction interface;
if the request type of the request is determined to be a creation request in the determining module, the sending module is specifically configured to create service identifier information in the creation request; and based on the service identification information, creating a context record text matched with the service identification information in the database, and sending the created context record text to the front end so that the front end can display the information in the created context record text in a human-computer interaction interface.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811463477.8A CN109582685B (en) | 2018-12-03 | 2018-12-03 | Method and device for recording context request execution process |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811463477.8A CN109582685B (en) | 2018-12-03 | 2018-12-03 | Method and device for recording context request execution process |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109582685A CN109582685A (en) | 2019-04-05 |
CN109582685B true CN109582685B (en) | 2023-01-10 |
Family
ID=65925983
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811463477.8A Active CN109582685B (en) | 2018-12-03 | 2018-12-03 | Method and device for recording context request execution process |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109582685B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110569456B (en) * | 2019-07-26 | 2022-03-08 | 广州视源电子科技股份有限公司 | WEB end data offline caching method and device and electronic equipment |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1581746A (en) * | 2003-08-15 | 2005-02-16 | 华为技术有限公司 | Treatment method for establishing context request of packet data protocol |
CN106250424A (en) * | 2016-07-22 | 2016-12-21 | 杭州朗和科技有限公司 | The searching method of a kind of daily record context, Apparatus and system |
CN106549997A (en) * | 2015-09-22 | 2017-03-29 | 阿里巴巴集团控股有限公司 | The acquisition methods and device of user context information |
CN108008911A (en) * | 2016-11-01 | 2018-05-08 | 阿里巴巴集团控股有限公司 | Read-write requests processing method and processing device |
CN108536613A (en) * | 2018-03-08 | 2018-09-14 | 阿里巴巴集团控股有限公司 | Data clearing method, device and server |
CN109634845A (en) * | 2018-11-13 | 2019-04-16 | 微梦创科网络科技(中国)有限公司 | A kind of method and device generating context record text |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7305475B2 (en) * | 1999-10-12 | 2007-12-04 | Webmd Health | System and method for enabling a client application to operate offline from a server |
US9063725B2 (en) * | 2005-06-24 | 2015-06-23 | Oracle International Corporation | Portable management |
-
2018
- 2018-12-03 CN CN201811463477.8A patent/CN109582685B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1581746A (en) * | 2003-08-15 | 2005-02-16 | 华为技术有限公司 | Treatment method for establishing context request of packet data protocol |
CN106549997A (en) * | 2015-09-22 | 2017-03-29 | 阿里巴巴集团控股有限公司 | The acquisition methods and device of user context information |
CN106250424A (en) * | 2016-07-22 | 2016-12-21 | 杭州朗和科技有限公司 | The searching method of a kind of daily record context, Apparatus and system |
CN108008911A (en) * | 2016-11-01 | 2018-05-08 | 阿里巴巴集团控股有限公司 | Read-write requests processing method and processing device |
CN108536613A (en) * | 2018-03-08 | 2018-09-14 | 阿里巴巴集团控股有限公司 | Data clearing method, device and server |
CN109634845A (en) * | 2018-11-13 | 2019-04-16 | 微梦创科网络科技(中国)有限公司 | A kind of method and device generating context record text |
Non-Patent Citations (4)
Title |
---|
NetRS: Cutting Response Latency in Distributed Key-Value Stores with In-Network Replica Selection;Yi Su 等;《2018 IEEE 38th International Conference on Distributed Computing Systems (ICDCS)》;20180723;143-153 * |
Replicate and Bundle (RnB) -- A Mechanism for Relieving Bottlenecks in Data Centers;Shachar Raindel 等;《2013 IEEE 27th International Symposium on Parallel and Distributed Processing》;20130729;601-610 * |
基于语义的物联网服务架构及关键算法研究;贾冰;《中国博士学位论文全文数据库 信息科技辑》;20130815(第08(2013)期);I138-171 * |
消息中间件管理和监控系统的设计与实现;葛东遥;《中国优秀硕士学位论文全文数据库 信息科技辑》;20180115(第01(2018)期);I138-641 * |
Also Published As
Publication number | Publication date |
---|---|
CN109582685A (en) | 2019-04-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11687488B2 (en) | Directory deletion method and apparatus, and storage server | |
US11080239B2 (en) | Key value store using generation markers | |
CN108647357B (en) | Data query method and device | |
WO2019019642A1 (en) | Application information pushing method and apparatus, and computer device and storage medium | |
CN114356921A (en) | Data processing method, device, server and storage medium | |
US20200379670A1 (en) | Method, apparatus, and computer program product for determining usage change rate of storage system | |
CN109299352B (en) | Method and device for updating website data in search engine and search engine | |
CN110647460B (en) | A test resource management method, device and test client | |
CN105260202A (en) | Client file updating method and system | |
US20200311132A1 (en) | Key value store using change values for data properties | |
CN110780855A (en) | Method, device and system for uniformly managing and controlling interface | |
CN109213691B (en) | Method and apparatus for cache management | |
CN109582685B (en) | Method and device for recording context request execution process | |
CN110647423A (en) | Method, device and readable medium for creating storage volume mirror image based on application | |
CN109634845B (en) | Method and device for generating context record text | |
CN110389714B (en) | Method, apparatus and computer storage medium for data input and output | |
WO2025001183A1 (en) | Data processing method, electronic device, and storage medium | |
CN109660602B (en) | Data increment transmission method and device | |
KR20150123603A (en) | Method and system for managing database | |
CN107944010B (en) | Method and device for reading and writing files in distributed file system | |
CN112835887A (en) | Database management method, apparatus, computing device and storage medium | |
CN117271584A (en) | Data processing method and device, computer readable storage medium and electronic equipment | |
CN116578608A (en) | Product standard process data management method, storage medium and electronic device | |
CN116056055A (en) | Internet of things terminal resource occupation optimization method, system, device and storage medium | |
CN110968267B (en) | Data management method, device, server and system |
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 |