Data processing method, server, service node, system and storage medium
By obtaining the startup timestamps of the thread server and the application server, judging the startup sequence and performing data update tasks, the problem of strong startup coupling between the thread server and the application server is solved, ensuring the correctness of the data and the rapid response of the service node.
Patent Information
- Application Number
- CN202110445407.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-23
- Publication Date
- 2025-06-06
- Estimated Expiration
- 2041-04-23
AI Technical Summary
There is a strong coupling problem between the thread server and the application server startup, which affects the normality and efficiency of the service provided by the application server.
By obtaining the startup timestamps of the application server and thread server, it is determined whether the application server starts earlier than the thread server starts. If it is earlier than, the data update task will be performed to ensure the correctness of the data.
It solves the problem of strong coupling between thread server and application server startup, ensures the correctness of product data stored in the application server memory, avoids the occurrence of dirty data, and enables the service node to respond quickly.
Smart Images

Figure CN113127082B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and more specifically, to a service node-based data processing method, an application server, a thread server, a service node, a computer system, and a storage medium. Background Art
[0002] In a service node, the thread server periodically obtains product parameters from the product data source and updates them to the database. The application server obtains product data from the database and provides services to the application. Therefore, the normal service provided by the application server depends on the operation of the thread server. This dependency relationship leads to a strong coupling problem between the startup of the thread server and the application server. Summary of the invention
[0003] In view of this, the present disclosure provides a service node-based data processing method, an application server, a thread server, a service node, a computer system and a storage medium, which can solve the problem of strong coupling between the startup of the thread server and the application server.
[0004] One aspect of the present disclosure provides a data processing method based on a service node, wherein the service node includes a thread server and an application server, and the method is executed by the application server, and the method includes:
[0005] Obtain a first timestamp and a second timestamp, wherein the first timestamp is the timestamp when the application server starts, and the second timestamp is the timestamp when the thread server starts;
[0006] Determine whether the first timestamp is earlier than the second timestamp;
[0007] If the first timestamp is earlier than the second timestamp, the data update task is executed.
[0008] Optionally, after executing the data update task, the step further includes:
[0009] Obtain a current timestamp, and update the time of the first timestamp to the time of the current timestamp.
[0010] Optionally, the service node further includes a database, and the executing data update task includes:
[0011] Acquire product data stored in the database;
[0012] The product data stored in the memory of the application server is updated to the product data stored in the database.
[0013] Optionally, the first timestamp is stored in the memory of the application server, and the second timestamp is stored in the database;
[0014] The obtaining of the first timestamp and the second timestamp comprises:
[0015] The first timestamp is obtained from the memory, and the second timestamp is obtained from the database.
[0016] Optionally, the operation of obtaining the first timestamp and the second timestamp is performed at preset time intervals.
[0017] Another aspect of the present disclosure provides a data processing method based on a service node, wherein the service node includes a thread server and an application server, and the method is executed by the thread server, and the method includes:
[0018] When the thread server startup is detected to be complete, the timestamp of the startup completion is obtained;
[0019] The timestamp when the startup is completed is saved as a second timestamp, so that the application server obtains a first timestamp and a second timestamp, wherein the first timestamp is the timestamp when the application server starts to start, and whether the first timestamp is earlier than the second timestamp is determined. If the first timestamp is earlier than the second timestamp, a data update task is executed.
[0020] Optionally, the service node further includes a database, and after saving the timestamp when the startup is completed as the second timestamp, further includes:
[0021] The second timestamp is sent to a database, so that the application server obtains the second timestamp from the database.
[0022] Another aspect of the present disclosure provides an application server in a service node, comprising:
[0023] A first acquisition module is used to acquire a first timestamp and a second timestamp, wherein the first timestamp is a timestamp when the application server starts, and the second timestamp is a timestamp when the thread server starts;
[0024] A judging module, configured to judge whether the first timestamp is earlier than the second timestamp;
[0025] An updating module is used to execute a data updating task if the first timestamp is earlier than the second timestamp.
[0026] Optionally, also include:
[0027] The second acquisition module is used to obtain the current timestamp;
[0028] An updating module is used to update the moment of the first timestamp to the moment of the current timestamp.
[0029] Optionally, the service node further includes a database, and the update module is specifically configured to obtain product data stored in the database if the first timestamp is earlier than the second timestamp, and update the product data stored in the memory of the application server to the product data stored in the database.
[0030] Optionally, the first acquisition module is further configured to execute the operation of acquiring the first timestamp and the second timestamp at preset time intervals.
[0031] Another aspect of the present disclosure provides a thread server in a service node, comprising:
[0032] The third acquisition module is used to acquire the timestamp of the completion of the startup when detecting that the startup of the thread server is completed;
[0033] A saving module is used to save the timestamp when the startup is completed as a second timestamp, so that the application server obtains a first timestamp and a second timestamp, wherein the first timestamp is the timestamp when the application server starts to start, and determines whether the first timestamp is earlier than the second timestamp. If the first timestamp is earlier than the second timestamp, a data update task is executed.
[0034] Optionally, the service node further includes a database, and the thread server further includes:
[0035] A sending module is used to send the second timestamp to a database, so that the application server obtains the second timestamp from the database.
[0036] Another aspect of the present disclosure provides a service node, comprising:
[0037] The application server as described above, the thread server as described above.
[0038] Another aspect of the present disclosure provides a service node, comprising:
[0039] The application server as described above, the thread server as described above, and a database, wherein the database is used to store the second timestamp and product data.
[0040] Another aspect of the present disclosure provides a computer system, comprising:
[0041] one or more processors;
[0042] a memory for storing one or more programs,
[0043] When the one or more programs are executed by the one or more processors, the one or more processors implement any of the above methods.
[0044] Another aspect of the present disclosure provides a computer-readable storage medium storing computer-executable instructions, wherein the instructions are used to implement any of the above methods when executed.
[0045] Another aspect of the present disclosure provides a computer program, which includes computer executable instructions, and the instructions are used to implement any of the above methods when executed.
[0046] According to an embodiment of the present disclosure, the initialization order of the thread server and the application server is not controlled, but a first timestamp and a second timestamp are obtained, the first timestamp is the timestamp when the application server starts, and the second timestamp is the timestamp when the thread server starts. It is determined whether the first timestamp is earlier than the second timestamp. If the application server startup start time is earlier than the thread server startup completion time, the application server directly updates the product data stored in the memory once to ensure the correctness of the product data stored in the application server memory, avoid dirty data, and enable the current service node to quickly serve customers. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] The above and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:
[0048] Figure 1 A service node according to an embodiment of the present disclosure is schematically shown;
[0049] Figure 2 A flowchart of a data processing method based on a service node according to an embodiment of the present disclosure is schematically shown;
[0050] Figure 3 A flowchart of a data processing method based on a service node according to an embodiment of the present disclosure is schematically shown;
[0051] Figure 4 A flowchart of a data processing method based on a service node according to an embodiment of the present disclosure is schematically shown;
[0052] Figure 5 A flowchart of a data processing method based on a service node according to an embodiment of the present disclosure is schematically shown;
[0053] Figure 6 A flowchart of a data processing method based on a service node according to an embodiment of the present disclosure is schematically shown;
[0054] Figure 7 The structure block diagram of the application server according to the embodiment of the present disclosure is schematically shown;
[0055] Figure 8The structural block diagram of the thread server according to the embodiment of the present disclosure is schematically shown;
[0056] Fig. 9 The block diagram of a computer system according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0057] In order to make the purpose, features, and advantages of the present application more obvious and understandable, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.
[0058] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.
[0059] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0060] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification, and should not be interpreted in an idealized or overly rigid manner.
[0061] In the case of using expressions such as "at least one of A, B, and C, etc.", it should generally be interpreted in accordance with the meaning of the expression generally understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.). In the case of using expressions such as "at least one of A, B, or C, etc.", it should generally be interpreted in accordance with the meaning of the expression generally understood by those skilled in the art (for example, "a system having at least one of A, B, or C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0062] The embodiment of the present disclosure provides a data processing method based on a service node, wherein the service node includes a thread server and an application server. The method includes: when detecting that the thread server is started up, the thread server obtains the timestamp when the startup is completed, the thread server saves the timestamp when the startup is completed as a second timestamp, and when the application server starts a data update task, obtains a first timestamp and a second timestamp, the first timestamp is the timestamp when the application server starts up, the application server determines whether the first timestamp is earlier than the second timestamp, and if the first timestamp is earlier than the second timestamp, the application server executes the data update task, and obtains the current timestamp, and updates the moment of the first timestamp to the moment of the current timestamp.
[0063] Figure 1 The service node 100 according to an embodiment of the present disclosure is schematically shown. It should be noted that: Figure 1 What is shown are merely examples to which the embodiments of the present disclosure can be applied, so as to help those skilled in the art understand the technical content of the present disclosure, but it does not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios.
[0064] like Figure 1 As shown, a service node includes a database 101, a thread server 102 and at least one application server 103, and can provide services to users independently.
[0065] The database 101 is used to store product data, technical parameters and other contents, and can only be accessed by the server of this service node.
[0066] The thread server 102 refers to a server used to update product data in the database, and periodically obtains product data from a product data source and updates the data to the database.
[0067] The application server 103 refers to a server used to provide services to users, and relies on product data, and periodically reads product data from a database and saves it to a local memory.
[0068] The database 101, the thread server 102 and the application server 103 may communicate with each other via a wired and / or wireless network. Product data refers to information required to provide specific services to users, such as financial management, insurance and other information.
[0069] In the present disclosure, when the thread server 102 starts, it obtains product data from the product data source, and then updates the product data to the database 101. After all product parameters are updated, the thread server 102 starts, and then the timestamp of the thread server 102 starting completion is recorded. When the application server 103 starts, the timestamp of the start of the application server 103 is recorded in the memory, and then the latest timestamp of the start of the thread server 102 is obtained, and it is checked whether the time when the application server 103 starts is earlier than the time when the thread server 102 starts. If so, it means that the product data needs to be updated, and the data update task is executed, and the timestamp of the start of the startup in the memory is updated to the current timestamp; if the timestamp of the start of the application server 103 in the memory is not earlier than the timestamp of the start of the thread server 102, it means that the product parameters do not need to be updated, the data update task is not executed, and the first timestamp and the second timestamp are obtained next time.
[0070] It should be understood that Figure 1 The number of application servers in the example is only for illustration. Any number of application servers may be provided in a service node according to implementation requirements.
[0071] Figure 2 A flowchart of a data processing method based on a service node according to an embodiment of the present disclosure is schematically shown. The service node includes a thread server and an application server, and the data processing method is executed by the application server.
[0072] like Figure 2 As shown, the method includes operations S201 to S203.
[0073] In operation S201, a first timestamp and a second timestamp are obtained, wherein the first timestamp is the timestamp when the application server starts, and the second timestamp is the timestamp when the thread server starts.
[0074] In operation S202, it is determined whether the first timestamp is earlier than the second timestamp.
[0075] In operation S203, if the first timestamp is earlier than the second timestamp, a data update task is executed.
[0076] In the present disclosure, operation S201 is performed once every preset time period. The preset time period may be, for example, 5 seconds, 30 seconds, 1 minute, etc., and the present disclosure does not impose any limitation thereto. The data update task refers to the application server updating the product data stored in itself.
[0077] In the present disclosure, the timestamp when the application server starts is the time when the application server starts the data update task. In this embodiment, the timestamp when the thread server starts is the time when the thread server successfully obtains the product data from the product data source and successfully saves it. The storage location can be an external database or a storage space in the thread server.
[0078] In the present disclosure, if the first timestamp is not earlier than the second timestamp, the data update task is not performed. Wait until the preset time length is reached, and then perform operation S201 next time.
[0079] According to the embodiment of the present disclosure, the initialization order of the thread server and the application server is not controlled, but a first timestamp and a second timestamp are obtained, the first timestamp is the timestamp when the application server starts, and the second timestamp is the timestamp when the thread server starts. It is determined whether the first timestamp is earlier than the second timestamp. If the application server startup start time is earlier than the thread server startup completion time, the application server directly updates the product data stored in the memory once to ensure the correctness of the product data stored in the application server memory, avoid dirty data, and enable the current service node to quickly serve customers.
[0080] Figure 3 A flowchart of a data processing method based on a service node according to an embodiment of the present disclosure is schematically shown. The service node includes a thread server and an application server, and the data processing method is executed by the application server.
[0081] like Figure 3 As shown, the method includes operations S301 to S304.
[0082] In operation S301, a first timestamp and a second timestamp are obtained, wherein the first timestamp is the timestamp when the application server starts, and the second timestamp is the timestamp when the thread server starts.
[0083] In operation S302, it is determined whether the first timestamp is earlier than the second timestamp.
[0084] In operation S303, if the first timestamp is earlier than the second timestamp, a data update task is executed.
[0085] In operation S304, a current timestamp is obtained, and the time of the first timestamp is updated to the time of the current timestamp.
[0086] In an example, the first timestamp is 12:55:20 on March 30, 2021, and the second timestamp is 12:55:25 on March 30, 2021. The first timestamp is earlier than the second timestamp. In this case, the data update task is executed. After the task is completed, the current timestamp is obtained. Assuming that the current timestamp is 12:55:30 on March 30, 2021, the first timestamp is updated to 12:55:30 on March 30, 2021.
[0087] According to the embodiment of the present disclosure, after the application server completes the data update task, the first timestamp is updated to ensure that the first timestamp obtained each time the data update task is executed is a correct timestamp.
[0088] Figure 4 A flowchart of a data processing method based on a service node according to an embodiment of the present disclosure is schematically shown. The service node includes a thread server, an application server and a database, and the data processing method is executed by the application server.
[0089] like Figure 4 As shown, the method includes operations S401 to S403.
[0090] In operation S401, a first timestamp is obtained from a memory, and a second timestamp is obtained from a database, wherein the first timestamp is a timestamp when the application server starts, and the second timestamp is a timestamp when the thread server starts.
[0091] In operation S402, it is determined whether the first timestamp is earlier than the second timestamp.
[0092] In operation S403, if the first timestamp is earlier than the second timestamp, the product data stored in the database is acquired, and the product data stored in the memory of the application server is updated to the product data stored in the database.
[0093] In the present disclosure, thread server startup completion means that the thread server successfully saves the product data obtained from the product data source to the database. That is, the timestamp when the thread server startup is completed refers to the current time recorded after the thread server starts to start, obtains product data from the product data source, and then sends the obtained product data to the database, and the database successfully saves the product data.
[0094] In one embodiment of the present disclosure, after operation S403, a current timestamp is obtained, the moment of the first timestamp is updated to the moment of the current timestamp, and operation S401 is performed again.
[0095] Figure 5A flowchart of a data processing method based on a service node according to an embodiment of the present disclosure is schematically shown. The service node includes a thread server and an application server, and the data processing method is executed by the thread server.
[0096] like Figure 5 As shown, the method includes operations S501 to S503.
[0097] In operation S501, when it is detected that the thread server is started up and completed, a timestamp of when the startup is completed is obtained.
[0098] In operation S502, the timestamp when the startup is completed is saved as the second timestamp, so that the application server obtains the first timestamp and the second timestamp, the first timestamp is the timestamp when the application server starts to start, and it is determined whether the first timestamp is earlier than the second timestamp. If the first timestamp is earlier than the second timestamp, the data update task is executed.
[0099] In the present disclosure, thread server startup completion means that the thread server successfully obtains product data from the product data source and successfully saves it.
[0100] Figure 6 A flowchart of a data processing method based on a service node according to an embodiment of the present disclosure is schematically shown. The service node includes a thread server, an application server and a database, and the data processing method is executed by the thread server.
[0101] like Figure 6 As shown, the method includes operations S601 to S603.
[0102] In operation S601, when it is detected that the thread server is started up and completed, a timestamp of when the startup is completed is obtained.
[0103] In operation S602, the timestamp when the startup is completed is saved as a second timestamp;
[0104] In operation S603, the second timestamp is sent to the database so that the application server obtains the second timestamp and product data from the database, and determines whether the first timestamp is earlier than the second timestamp. If the first timestamp is earlier than the second timestamp, the product data stored in the memory of the application server is updated to the product data stored in the database.
[0105] Figure 7 The structural block diagram of the application server according to the embodiment of the present disclosure is schematically shown.
[0106] like Figure 7 As shown, the application server 700 includes a first acquisition module 710, a judgment module 720, and an update module 730. The application server 700 and Figure 1The application servers 103 shown are identical.
[0107] The first acquisition module 710 is used to acquire a first timestamp and a second timestamp, wherein the first timestamp is the timestamp when the application server starts, and the second timestamp is the timestamp when the thread server starts.
[0108] The determination module 720 is configured to determine whether the first timestamp is earlier than the second timestamp.
[0109] The updating module 730 is configured to execute a data updating task if the first timestamp is earlier than the second timestamp.
[0110] In one embodiment of the present disclosure, the thread server 700 further includes:
[0111] The second acquisition module is used to obtain the current timestamp;
[0112] An updating module is used to update the moment of the first timestamp to the moment of the current timestamp.
[0113] In one embodiment of the present disclosure, the service node also includes a database, and the update module 730 is specifically used to obtain the product data stored in the database if the first timestamp is earlier than the second timestamp, and update the product data stored in the memory of the application server to the product data stored in the database.
[0114] In one embodiment of the present disclosure, the first timestamp is stored in the memory of the application server, and the second timestamp is stored in the database; the first acquisition module is specifically used to acquire the first timestamp from the memory, and acquire the second timestamp from the database.
[0115] In one embodiment of the present disclosure, the first acquisition module is specifically configured to acquire the first timestamp and the second timestamp at preset time intervals.
[0116] Figure 8 The structural block diagram of the thread server according to an embodiment of the present disclosure is schematically shown.
[0117] like Figure 8 As shown, the thread server 800 includes a second acquisition module 810 and a storage module 820. Figure 1 The application servers 102 shown are identical.
[0118] The third acquisition module 810 is used to acquire the timestamp of the completion of the startup when detecting that the startup of the thread server is completed;
[0119] The saving module 820 is used to save the timestamp when the startup is completed as the second timestamp, so that the application server obtains the first timestamp and the second timestamp. The first timestamp is the timestamp when the application server starts to start, and determines whether the first timestamp is earlier than the second timestamp. If the first timestamp is earlier than the second timestamp, the data update task is executed.
[0120] In one embodiment of the present disclosure, the service node also includes a database, and the thread server 800 also includes:
[0121] The sending module is used to send the second timestamp to the database, so that the application server obtains the second timestamp from the database.
[0122] According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits, or at least part of the functions of any one of them can be implemented in one module. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be split into multiple modules for implementation. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be at least partially implemented as hardware circuits, such as field programmable gate arrays (FPGAs), programmable logic arrays (PLAs), systems on chips, systems on substrates, systems on packages, application specific integrated circuits (ASICs), or can be implemented by hardware or firmware in any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware, and firmware, or in any appropriate combination of any of them. Alternatively, according to the embodiments of the present invention, one or more of the modules, submodules, units, and subunits can be at least partially implemented as computer program modules, and when the computer program modules are run, the corresponding functions can be performed.
[0123] For example, any multiple of the first acquisition module 710, the judgment module 720, and the update module 730 can be combined in one module / unit / sub-unit for implementation, or any one of the modules / units / sub-units can be split into multiple modules / units / sub-units. Alternatively, at least part of the functions of one or more of these modules / units / sub-units can be combined with at least part of the functions of other modules / units / sub-units and implemented in one module / unit / sub-unit. According to an embodiment of the present disclosure, at least one of the first acquisition module 710, the judgment module 720, and the update module 730 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or by any one of the three implementation methods of software, hardware, and firmware, or by a suitable combination of any of them. Alternatively, at least one of the first acquisition module 710 , the determination module 720 , and the update module 730 may be at least partially implemented as a computer program module, and when the computer program module is executed, a corresponding function may be executed.
[0124] It should be noted that in the above embodiments, the description of each embodiment has its own emphasis, and for parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0125] Fig. 9 A block diagram of a computer system suitable for implementing the method described above according to an embodiment of the present disclosure is schematically shown. Fig. 9 The computer system 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.
[0126] like Fig. 9 As shown, the computer system 900 according to the embodiment of the present disclosure includes a processor 901, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 902 or the program loaded from the storage part 908 to the random access memory (RAM) 903. The processor 901 may include, for example, a general-purpose microprocessor (such as a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (for example, an application-specific integrated circuit (ASIC)), etc. The processor 901 may also include an onboard memory for caching purposes. The processor 901 may include a single processing unit or multiple processing units for performing different actions of the method flow according to the embodiment of the present disclosure.
[0127] In RAM 903, various programs and data required for the operation of system 900 are stored. Processor 901, ROM 902 and RAM 903 are connected to each other through bus 904. Processor 901 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 902 and / or RAM 903. It should be noted that the program can also be stored in one or more memories other than ROM 902 and RAM 903. Processor 901 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.
[0128] According to an embodiment of the present disclosure, the system 900 may further include an input / output (I / O) interface 905, which is also connected to the bus 904. The system 900 may further include one or more of the following components connected to the I / O interface 905: an input section 906 including a keyboard, a mouse, etc.; an output section 907 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 908 including a hard disk, etc.; and a communication section 909 including a network interface card such as a LAN card, a modem, etc. The communication section 909 performs communication processing via a network such as the Internet. A drive 910 is also connected to the I / O interface 905 as needed. A removable medium 911, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 910 as needed, so that a computer program read therefrom is installed into the storage section 908 as needed.
[0129] According to an embodiment of the present disclosure, the method flow according to an embodiment of the present disclosure can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 909, and / or installed from the removable medium 911. When the computer program is executed by the processor 901, the above-mentioned functions defined in the system of the embodiment of the present disclosure are executed. According to an embodiment of the present disclosure, the system, equipment, device, module, unit, etc. described above can be implemented by a computer program module.
[0130] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.
[0131] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium. For example, it may include, but is not limited to: 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), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, apparatus, or device.
[0132] For example, according to an embodiment of the present disclosure, the computer-readable storage medium may include the ROM 902 and / or the RAM 903 described above and / or one or more memories other than the ROM 902 and the RAM 903 .
[0133] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two 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 box in the block diagram or flow chart, and the combination of the boxes in the block diagram 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.
[0134] It will be appreciated by those skilled in the art that the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways, even if such combinations and / or combinations are not explicitly described in the present disclosure. In particular, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways without departing from the spirit and teachings of the present disclosure. All of these combinations and / or combinations fall within the scope of the present disclosure.
[0135] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. The scope of the present disclosure is defined by the attached claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.
Claims
1. A data processing method based on a service node, wherein the service node includes a thread server and an application server, and the method is executed by the application server. include: Obtain a first timestamp and a second timestamp, wherein the first timestamp is the timestamp when the application server starts, and the second timestamp is the timestamp when the thread server starts; Determine whether the first timestamp is earlier than the second timestamp; If the first timestamp is earlier than the second timestamp, executing the data update task; The service node also includes a database, and the execution of the data update task includes: Acquire product data stored in the database; updating the product data stored in the memory of the application server to the product data stored in the database, After executing the data update task, the method further includes: Get the current timestamp; Updating the time of the first timestamp to the time of the current timestamp; At preset time intervals, the operation of obtaining the first timestamp and the second timestamp is performed; The first timestamp is stored in the memory of the application server, and the second timestamp is stored in the database; The obtaining of the first timestamp and the second timestamp comprises: Acquire the first timestamp from the memory, and acquire the second timestamp from the database; The timestamp when the application server starts is the time when the application server starts the data update task; The timestamp when the thread server is started is the current time recorded after the thread server is started, product data is obtained from the product data source, and then the obtained product data is sent to the database, and the database successfully saves the product data.
2. A data processing method based on a service node, wherein the service node includes a thread server and an application server, and the method is executed by the thread server. include: When the thread server startup is detected to be complete, the timestamp of the startup completion is obtained; The timestamp when the thread server is started is saved as the second timestamp, so that the application server obtains the first timestamp and the second timestamp, the first timestamp is the timestamp when the application server is started, and it is determined whether the first timestamp is earlier than the second timestamp. If the first timestamp is earlier than the second timestamp, the data update task is executed. After executing the data update task, the method further includes: Get the current timestamp; Updating the time of the first timestamp to the time of the current timestamp; At preset time intervals, the operation of obtaining the first timestamp and the second timestamp is performed; The service node further includes a database, and after saving the timestamp when the startup is completed as the second timestamp, further includes: Sending the second timestamp to a database, so that the application server obtains the second timestamp from the database; The first timestamp is stored in the memory of the application server, and the second timestamp is stored in the database; The obtaining of the first timestamp and the second timestamp comprises: Acquire the first timestamp from the memory, and acquire the second timestamp from the database; The timestamp when the application server starts is the time when the application server starts the data update task; The timestamp when the thread server is started is the current time recorded after the thread server is started, product data is obtained from the product data source, and then the obtained product data is sent to the database, and the database successfully saves the product data.
3. An application server in a service node, include: A first acquisition module is used to acquire a first timestamp and a second timestamp, wherein the first timestamp is a timestamp when the application server starts, and the second timestamp is a timestamp when the thread server starts; A judging module, configured to judge whether the first timestamp is earlier than the second timestamp; An updating module, configured to execute a data updating task if the first timestamp is earlier than the second timestamp; The second acquisition module is used to obtain the current timestamp; An updating module, configured to update the moment of the first timestamp to the moment of the current timestamp; At preset time intervals, the operation of obtaining the first timestamp and the second timestamp is performed; The service node further includes a database, and the update module is specifically configured to obtain the product data stored in the database if the first timestamp is earlier than the second timestamp, and update the product data stored in the memory of the application server to the product data stored in the database; The first timestamp is stored in the memory of the application server, and the second timestamp is stored in the database; The obtaining of the first timestamp and the second timestamp comprises: Acquire the first timestamp from the memory, and acquire the second timestamp from the database; The timestamp when the application server starts is the time when the application server starts the data update task; The timestamp when the thread server is started is the current time recorded after the thread server is started, product data is obtained from the product data source, and then the obtained product data is sent to the database, and the database successfully saves the product data.
4. A thread server in a service node, include: The third acquisition module is used to acquire the timestamp of the completion of the startup when detecting that the startup of the thread server is completed; A saving module is used to save the timestamp when the thread server is started as a second timestamp, so that the application server obtains the first timestamp and the second timestamp, the first timestamp is the timestamp when the application server starts, and judge whether the first timestamp is earlier than the second timestamp. If the first timestamp is earlier than the second timestamp, the data update task is executed. After executing the data update task, the method further includes: Get the current timestamp; Updating the time of the first timestamp to the time of the current timestamp; At preset time intervals, the operation of obtaining the first timestamp and the second timestamp is performed; The service node also includes a database, and the thread server also includes: A sending module, configured to send the second timestamp to a database, so that the application server obtains the second timestamp from the database; The first timestamp is stored in the memory of the application server, and the second timestamp is stored in the database; The obtaining of the first timestamp and the second timestamp comprises: Acquire the first timestamp from the memory, and acquire the second timestamp from the database; The timestamp when the application server starts is the time when the application server starts the data update task; The timestamp when the thread server is started is the current time recorded after the thread server is started, product data is obtained from the product data source, and then the obtained product data is sent to the database, and the database successfully saves the product data.
5. A service node, include: The application server as claimed in claim 3, the thread server as claimed in claim 4.
6. A service node, include: The application server according to claim 3, the thread server according to claim 4, and a database, wherein the database is used to store the second timestamp and the product data.
7. A computer system, include: one or more processors; a memory for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method of claim 1.
8. A computer system, include: one or more processors; a memory for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method of claim 2.
9. A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, enables the processor to implement the method of claim 1.
10. A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, enables the processor to implement the method of claim 2.
Citation Information
Patent Citations
Cloud synchronization method based on education operating system and electronic equipment
CN109309582A